test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java
changeset 52066 49a21be61dcd
parent 50735 2f2af62dfac7
child 53853 7ca9e625d6b2
equal deleted inserted replaced
52065:dea8a62cdfc3 52066:49a21be61dcd
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8046171
    26  * @bug 8046171 8211065
    27  * @summary Setup nestmate calls to private methods then use
    27  * @summary Setup nestmate calls to private methods then use
    28  *          modified jcod classes to introduce errors. Test with
    28  *          modified jcod classes to introduce errors. Test with
    29  *          and without verification enabled
    29  *          and without verification enabled
    30  * @compile TestInvokeErrors.java
    30  * @compile TestInvokeErrors.java
    31  * @compile MissingMethod.jcod
    31  * @compile MissingMethod.jcod
    94         }
    94         }
    95         catch (NoSuchMethodError nsme) {
    95         catch (NoSuchMethodError nsme) {
    96             System.out.println("Got expected exception:" + nsme);
    96             System.out.println("Got expected exception:" + nsme);
    97         }
    97         }
    98 
    98 
    99         try {
    99         // This test was revised to expect successful invocation of the
   100             MissingMethodWithSuper m = new MissingMethodWithSuper();
   100         // super class method - see JDK-8211065
   101             m.priv_invoke();
   101         MissingMethodWithSuper m = new MissingMethodWithSuper();
   102             throw new Error("Unexpected success invoking MissingMethodWithSuper.priv_invoke");
   102         m.priv_invoke();
   103         }
       
   104         catch (NoSuchMethodError nsme) {
       
   105             System.out.println("Got expected exception:" + nsme);
       
   106         }
       
   107 
   103 
   108         // Verification of Helper will trigger the nestmate access check failure
   104         // Verification of Helper will trigger the nestmate access check failure
   109         try {
   105         try {
   110             Helper.doTest();
   106             Helper.doTest();
   111         }
   107         }