Generate Threshold{Class,Type} properties for all classes #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a class derives from
Java.Lang.Object
it should have the two propertiesmentioned above generated, so that it is possible to find methods in the correct
instance of Java class instance that is wrapped by our managed class.
Generator used to decide whether or not to generate these properties based on
the presence of class members (fields, constructors, methods and properties) or
whether the class is an annotation in the API description file.
However there exist a number of classes (for instance
Inet4Address
) which don'thave any of the members present and yet they should have the Threshold*
properties generated for the reasons described above.
The
HasClassHandle
property which was used to determine whether the class shouldget these properties (among a handful of other members) doesn't serve its
purpose correctly leading to corner cases when the
Threshold*
properties aremissing and causing runtime bugs (e.g. calling
GetAddress()
on an instance ofInet4Address
returnsnull
even though the underlying Java class has theinformation - the call never reaches
Inet4Address
instance and thus returnsnothing).
Replacing
HasClassHandle
with a simple check for whether the class in questionderives from
Java.Lang.Object
is the correct fix that ensures the missingproperties are generated.
Fixe https://bugzilla.xamarin.com/show_bug.cgi?id=56537