< prev index next >

test/hotspot/jtreg/runtime/HiddenClasses/NestedHidden.java

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com
rev 58568 : [mq]: hidden-class-4


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary Creates a hidden class inside of a hidden class.
  27  * @library /test/lib
  28  * @modules java.compiler
  29  *          java.management
  30  * @run main p.NestedHidden
  31  */
  32 
  33 package p;
  34 
  35 import java.lang.*;
  36 
  37 import java.lang.invoke.MethodHandles;
  38 import java.lang.invoke.MethodHandles.Lookup;
  39 import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*;
  40 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  41 
  42 
  43 // Test that a hidden class can define its own hidden class by calling
  44 // lookup.defineHiddenClass().
  45 public class NestedHidden {
  46     static byte klassbuf[] = InMemoryJavaCompiler.compile("p.TestClass",
  47         "package p; " +
  48         "public class TestClass { " +
  49         "    public static void concat(String one, String two) throws Throwable { " +




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary Creates a hidden class inside of a hidden class.
  27  * @library /test/lib
  28  * @modules jdk.compiler

  29  * @run main p.NestedHidden
  30  */
  31 
  32 package p;
  33 
  34 import java.lang.*;
  35 
  36 import java.lang.invoke.MethodHandles;
  37 import java.lang.invoke.MethodHandles.Lookup;
  38 import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*;
  39 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  40 
  41 
  42 // Test that a hidden class can define its own hidden class by calling
  43 // lookup.defineHiddenClass().
  44 public class NestedHidden {
  45     static byte klassbuf[] = InMemoryJavaCompiler.compile("p.TestClass",
  46         "package p; " +
  47         "public class TestClass { " +
  48         "    public static void concat(String one, String two) throws Throwable { " +


< prev index next >