Details
-
Sub-task
-
Resolution: Fixed
-
P4
-
9
-
None
-
b20
Description
Need a test to verify if Module::getResourceAsStream handles properly with null caller. Same verification is needed for Class::getResourceAsStream.
if (isNamed() && Resources.canEncapsulate(name)) {
Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this && caller != Object.class.getModule()) {
String pn = Resources.toPackageName(name);
if (getPackages().contains(pn)) {
if (caller == null && !isOpen(pn)) {
// no caller, package not open
return null;
}
if (!isOpen(pn, caller)) {
// package not open to caller
return null;
}
}
}
}
if (isNamed() && Resources.canEncapsulate(name)) {
Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this && caller != Object.class.getModule()) {
String pn = Resources.toPackageName(name);
if (getPackages().contains(pn)) {
if (caller == null && !isOpen(pn)) {
// no caller, package not open
return null;
}
if (!isOpen(pn, caller)) {
// package not open to caller
return null;
}
}
}
}