Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.9.3
-
Fix Version/s: 3.0
-
Component/s: Runtime: JNI
-
Labels:None
-
Number of attachments :
Description
When creating a new object by reflection in JNI code we wrap the method in a constructor object then invoke it to create a new instance, however the provided method may belong to a super class object if the class didn't declare a constructor of its own - in which case we get an object of the super class type in our current implementation.
It's not clear to me whether this is a bug in GetMethodID or NewObject.. GetMethodID uses a class to find a named method.. but then from that method it gets the reference.. if there was no overriding method then GetMethodID will return the ID of a method in the super class, rather than one that belongs to the class in question. This is certainly causing the NewObject bug, but its not clear whether we want to fix NewObject or GetMethodID.