RVM

Class argument in NewObject ignored

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.9.3
  • Fix Version/s: 3.0
  • Component/s: Runtime: JNI
  • Labels:
    None
  • Number of attachments :
    0

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.

Activity

Hide
Ian Rogers added a comment -

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.

Show
Ian Rogers added a comment - 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.
Hide
Ian Rogers added a comment -

Fix in r14598.

Show
Ian Rogers added a comment - Fix in r14598.
Hide
David Grove added a comment -

reopening so I can modify fix target to 3.0

Show
David Grove added a comment - reopening so I can modify fix target to 3.0

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: