mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8281006: Module::getResourceAsStream should check if the resource is open unconditionally when caller is null
Reviewed-by: alanb, erikj, mchung
This commit is contained in:
parent
018017a917
commit
e8016f7443
8 changed files with 393 additions and 8 deletions
|
@ -3002,9 +3002,9 @@ public final class Class<T> implements java.io.Serializable,
|
|||
if (callerModule != thisModule) {
|
||||
String pn = Resources.toPackageName(name);
|
||||
if (thisModule.getDescriptor().packages().contains(pn)) {
|
||||
if (callerModule == null && !thisModule.isOpen(pn)) {
|
||||
// no caller, package not open
|
||||
return false;
|
||||
if (callerModule == null) {
|
||||
// no caller, return true if the package is open to all modules
|
||||
return thisModule.isOpen(pn);
|
||||
}
|
||||
if (!thisModule.isOpen(pn, callerModule)) {
|
||||
// package not open to caller
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue