RFR 8154587: Resolution fails for default method named 'clone'
Lois Foltan
lois.foltan at oracle.com
Mon Dec 4 19:31:01 UTC 2017
Hi Harold,
Fix looks good. I would like to see three more test cases:
- the same test written for "finalize" since that is also a
non-public method of Object.
- a test where class C does not define the method "clone", an IAE
should result, correct?
- a test case where I2 defines a public method of Object
Thanks,
Lois
On 11/30/2017 11:15 AM, harold seigel wrote:
> Hi,
>
> Please review this fix for JDK-8154587. The fix adds additional
> special casing to skip over non-public methods in class
> java.lang.Object during default method and itable processing for
> interfaces. These methods need to be skipped over because of the
> interface method resolution rules in JVM Spec 9, section 5.4.3.4
> <https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-5.html#jvms-5.4.3.4>:
>
> 3. Otherwise, if the class|Object|declares a method with the name
> and descriptor specified by the interface method reference, which
> has its|ACC_PUBLIC|flag set and does not have its|ACC_STATIC|flag
> set, method lookup succeeds.
>
> Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8154587/webrev/
>
> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8154587
>
> The fix was tested with JCK lang and VM tests, JTReg hotspot and many
> JTReg JDK tests, M5 tier1 - tier5 tests, and JPRT.
>
> Thanks, Harold
>
More information about the hotspot-runtime-dev
mailing list