Mercurial > hg > truffle
comparison test/runtime/8024804/RegisterNatives.java @ 13436:9fbabcbb875b
8028741: Interface Method Resolution should skip static and non-public methods in j.l.Object
Summary: Implementation of JDK 8 JVMS 5.4.3.4 specification change to skip static and non-public methods of java.lang.Object for interface method resolution.
Reviewed-by: acorn, coleenp
Contributed-by: lois.foltan@oracle.com
author | hseigel |
---|---|
date | Tue, 10 Dec 2013 16:18:26 -0500 |
parents | 7a58803b5069 |
children |
comparison
equal
deleted
inserted
replaced
13435:bf15208b72a5 | 13436:9fbabcbb875b |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 | 23 |
24 /* | 24 /* |
25 * @ignore 8028741 | |
26 * @test | 25 * @test |
27 * @bug 8024804 | 26 * @bug 8024804 |
28 * @summary registerNatives() interface resolution should receive IAE | 27 * @bug 8028741 |
28 * @summary interface method resolution should skip finding j.l.Object's registerNatives() and succeed in selecting class B's registerNatives() | |
29 * @run main RegisterNatives | 29 * @run main RegisterNatives |
30 */ | 30 */ |
31 public class RegisterNatives { | 31 public class RegisterNatives { |
32 interface I { void registerNatives(); } | 32 interface I { void registerNatives(); } |
33 interface J extends I {} | 33 interface J extends I {} |
36 System.out.println("Regression test for JDK-8024804, crash when InterfaceMethodref resolves to Object.registerNatives\n"); | 36 System.out.println("Regression test for JDK-8024804, crash when InterfaceMethodref resolves to Object.registerNatives\n"); |
37 J val = new B(); | 37 J val = new B(); |
38 try { | 38 try { |
39 val.registerNatives(); | 39 val.registerNatives(); |
40 } catch (IllegalAccessError e) { | 40 } catch (IllegalAccessError e) { |
41 System.out.println("TEST PASSES - according to current JVM spec, IAE expected\n"); | 41 System.out.println("TEST FAILS - JDK 8 JVMS, static and non-public methods of j.l.Object should be ignored during interface method resolution\n"); |
42 return; | 42 e.printStackTrace(); |
43 throw e; | |
43 } | 44 } |
44 System.out.println("TEST FAILS - no IAE resulted\n"); | 45 System.out.println("TEST PASSES - no IAE resulted\n"); |
45 System.exit(1); | |
46 } | 46 } |
47 } | 47 } |