--- old/test/jdk/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java 2019-07-01 19:28:03.000000000 -0700 +++ new/test/jdk/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java 2019-07-01 19:28:03.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,6 +82,7 @@ } // Invoke MethodHandles.privateLookupIn with a reduced-power caller + @Test(expectedExceptions = {IllegalAccessException.class}) public void testReducedAccessCallerSameModule() throws Throwable { Lookup caller = MethodHandles.lookup().dropLookupMode(PACKAGE); assertTrue((caller.lookupModes() & PRIVATE) == 0); @@ -89,12 +90,6 @@ assertTrue((caller.lookupModes() & MODULE) != 0); Lookup lookup = MethodHandles.privateLookupIn(nonPublicType, caller); - assertTrue(lookup.lookupClass() == nonPublicType); - assertTrue(lookup.hasPrivateAccess()); - - // use it - MethodHandle mh = lookup.findStaticGetter(nonPublicType, "obj", Object.class); - Object obj = mh.invokeExact(); } // Invoke MethodHandles.privateLookupIn with the public lookup as caller