< prev index next >

test/runtime/defineAnonClass/NestedUnsafe.java

Print this page

        

*** 37,47 **** import java.security.ProtectionDomain; import java.io.InputStream; import java.lang.*; import jdk.test.lib.*; import jdk.internal.misc.Unsafe; - import jdk.test.lib.unsafe.UnsafeHelper; // Test that an anonymous class in package 'p' cannot define its own anonymous class // in another package. public class NestedUnsafe { --- 37,46 ----
*** 52,62 **** " public static void concat(String one, String two) throws Throwable { " + " System.out.println(one + two);" + " } } "); public static void main(String args[]) throws Exception { ! Unsafe unsafe = UnsafeHelper.getUnsafe(); // The anonymous class calls defineAnonymousClass creating a nested anonymous class. byte klassbuf2[] = InMemoryJavaCompiler.compile("p.TestClass2", "package p; " + "import jdk.internal.misc.Unsafe; " + --- 51,61 ---- " public static void concat(String one, String two) throws Throwable { " + " System.out.println(one + two);" + " } } "); public static void main(String args[]) throws Exception { ! Unsafe unsafe = Unsafe.getUnsafe(); // The anonymous class calls defineAnonymousClass creating a nested anonymous class. byte klassbuf2[] = InMemoryJavaCompiler.compile("p.TestClass2", "package p; " + "import jdk.internal.misc.Unsafe; " +
< prev index next >