< prev index next >

test/runtime/defineAnonClass/NestedUnsafe2.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 that gets put in its host's package cannot define // an anonymous class in another package. public class NestedUnsafe2 { --- 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("TestClass2", "import jdk.internal.misc.Unsafe; " + "public class TestClass2 { " + --- 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("TestClass2", "import jdk.internal.misc.Unsafe; " + "public class TestClass2 { " +
< prev index next >