Skip to content
Permalink
Browse files

8244961: MethodHandles::privateLookupIn throws NPE when called during…

… initPhase2

Reviewed-by: chegar
  • Loading branch information
Mandy Chung
Mandy Chung committed May 15, 2020
1 parent cab61f1 commit b883badc47bf66ff4781f65bdd23c42549adf91a
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -256,12 +256,12 @@ public static Lookup privateLookupIn(Class<?> targetClass, Lookup caller) throws
// M2 != M1, set previous lookup class to M1 and drop MODULE access
newPreviousClass = callerClass;
newModes &= ~Lookup.MODULE;
}

if (!callerModule.isNamed() && targetModule.isNamed()) {
IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger();
if (logger != null) {
logger.logIfOpenedForIllegalAccess(caller, targetClass);
if (!callerModule.isNamed() && targetModule.isNamed()) {
IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger();
if (logger != null) {
logger.logIfOpenedForIllegalAccess(caller, targetClass);
}
}
}
return Lookup.newLookup(targetClass, newPreviousClass, newModes);

0 comments on commit b883bad

Please sign in to comment.
You can’t perform that action at this time.