JDK-8028741 : Interface Method Resolution should skip static and non-public methods in j.l.Object
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-11-20
  • Updated: 2014-01-14
  • Resolved: 2013-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8Fixed 9Fixed hs25Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Interface Method Resolution should skip static and non-public methods in j.l.Object
Comments
Release team: Approved for fixing
10-12-2013

Given importance of this fix, no existing workaround and low risk, SQE approves this fix for JDK-8
10-12-2013

Assuming this fixes hotspot/test/runtime/8024804/RegisterNatives.java, you now need to change the test to remove the @ignore 8028741. Thanks.
03-12-2013

Duplicate bug (with the fix for 8026066, before 8028741): and a good test for part of 8028741: hotspot/test/runtime/8024804/RegisterNatives.java with 8026066 but without 8028741: fails with Failed: 'main' threw exception: java.lang.IncompatibleClassChangeError: Expected instance not static method RegisterNatives$J.registerNatives()V
03-12-2013

If this change is not backported (reasonable, since it is responding to a spec change), the fix for JDK-8024804 will be on shaky ground -- no longer relevant in 8, but still (because of a backport) strangely producing an IAE in 7. I'd suggest changing the 7 fix for JDK-8024804 to either i) allow resolution to 'Object.registerNatives' and continue to selection without error, or ii) skip static methods of Object during resolution. Both of these alternatives are compatible, because old behavior was a crash. (i) is consistent with the way other methods of Object are treated in 7 (and sticks to a strict interpretation of JVMS 7), while (ii) is consistent with the way static methods are treated in 8.
20-11-2013

My concern about selecting 'registerNatives' is now covered by JDK-8028626.
20-11-2013

Comment from Dan Smith via email: I have some related concerns about JDK-8024804 that I can report separately or leave bundled up in the same bug: - There used to be a crash during _selection_ as well as during _resolution_, and this seems to have been turned into an IAE as well by the patch. But, as a static method, registerNatives should never be selected.
20-11-2013