mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8328261: public lookup fails with IllegalAccessException when used while module system is being initialized
Reviewed-by: rriggs, alanb
This commit is contained in:
parent
3b305d502b
commit
132921683b
1 changed files with 4 additions and 8 deletions
|
@ -201,9 +201,10 @@ public class VerifyAccess {
|
|||
Module lookupModule = lookupClass.getModule();
|
||||
Module refModule = refc.getModule();
|
||||
|
||||
// early VM startup case, java.base not defined
|
||||
if (lookupModule == null) {
|
||||
assert refModule == null;
|
||||
// early VM startup case, java.base not defined or
|
||||
// module system is not fully initialized and exports are not set up
|
||||
if (lookupModule == null || !jdk.internal.misc.VM.isModuleSystemInited()) {
|
||||
assert lookupModule == refModule;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -230,11 +231,6 @@ public class VerifyAccess {
|
|||
if (isModuleAccessible(refc, lookupModule, prevLookupModule))
|
||||
return true;
|
||||
|
||||
// not exported but allow access during VM initialization
|
||||
// because java.base does not have its exports setup
|
||||
if (!jdk.internal.misc.VM.isModuleSystemInited())
|
||||
return true;
|
||||
|
||||
// public class not accessible to lookupClass
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue