< prev index next >
src/java.base/share/classes/java/lang/ClassLoader.java
Print this page
*** 494,504 ****
}
final String name = cls.getName();
final int i = name.lastIndexOf('.');
if (i != -1) {
! AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
sm.checkPackageAccess(name.substring(0, i));
return null;
}
}, new AccessControlContext(new ProtectionDomain[] {pd}));
--- 494,504 ----
}
final String name = cls.getName();
final int i = name.lastIndexOf('.');
if (i != -1) {
! AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
sm.checkPackageAccess(name.substring(0, i));
return null;
}
}, new AccessControlContext(new ProtectionDomain[] {pd}));
*** 1263,1273 ****
private static Enumeration<URL> getBootstrapResources(String name)
throws IOException
{
final Enumeration<Resource> e =
getBootstrapClassPath().getResources(name);
! return new Enumeration<URL> () {
public URL nextElement() {
return e.nextElement().getURL();
}
public boolean hasMoreElements() {
return e.hasMoreElements();
--- 1263,1273 ----
private static Enumeration<URL> getBootstrapResources(String name)
throws IOException
{
final Enumeration<Resource> e =
getBootstrapClassPath().getResources(name);
! return new Enumeration<> () {
public URL nextElement() {
return e.nextElement().getURL();
}
public boolean hasMoreElements() {
return e.hasMoreElements();
*** 1865,1875 ****
// Check to see if we're attempting to access a static library
String name = NativeLibrary.findBuiltinLib(file.getName());
boolean isBuiltin = (name != null);
if (!isBuiltin) {
name = AccessController.doPrivileged(
! new PrivilegedAction<String>() {
public String run() {
try {
return file.exists() ? file.getCanonicalPath() : null;
} catch (IOException e) {
return null;
--- 1865,1875 ----
// Check to see if we're attempting to access a static library
String name = NativeLibrary.findBuiltinLib(file.getName());
boolean isBuiltin = (name != null);
if (!isBuiltin) {
name = AccessController.doPrivileged(
! new PrivilegedAction<>() {
public String run() {
try {
return file.exists() ? file.getCanonicalPath() : null;
} catch (IOException e) {
return null;
< prev index next >