Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8244961: MethodHandles::privateLookupIn throws NPE when called during…
Browse files Browse the repository at this point in the history
… initPhase2

Reviewed-by: chegar
  • Loading branch information
Mandy Chung committed May 15, 2020
1 parent cab61f1 commit b883bad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/java.base/share/classes/java/lang/invoke/MethodHandles.java
Expand Up @@ -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);
Expand Down

0 comments on commit b883bad

Please sign in to comment.