< prev index next >

test/jdk/java/lang/invoke/defineHiddenClass/HiddenNestmateTest.java

Print this page

        

*** 105,117 **** int x1 = testInjectedClass(c); assertTrue(x1 == privMethod()); } @Test ! public void hiddenWeakClass() throws Throwable { ! // define a weak class ! Lookup lookup = MethodHandles.lookup().defineHiddenClass(bytes, false, NESTMATE, WEAK); assertNestmate(lookup); } @Test(expectedExceptions = IllegalAccessException.class) public void noPrivateLookupAccess() throws Throwable { --- 105,117 ---- int x1 = testInjectedClass(c); assertTrue(x1 == privMethod()); } @Test ! public void hiddenStrongClass() throws Throwable { ! // define a hidden class strongly referenced by the class loader ! Lookup lookup = MethodHandles.lookup().defineHiddenClass(bytes, false, NESTMATE, STRONG); assertNestmate(lookup); } @Test(expectedExceptions = IllegalAccessException.class) public void noPrivateLookupAccess() throws Throwable {
< prev index next >