< prev index next >
src/java.base/share/classes/java/lang/ClassLoader.java
Print this page
@@ -494,11 +494,11 @@
}
final String name = cls.getName();
final int i = name.lastIndexOf('.');
if (i != -1) {
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
sm.checkPackageAccess(name.substring(0, i));
return null;
}
}, new AccessControlContext(new ProtectionDomain[] {pd}));
@@ -1263,11 +1263,11 @@
private static Enumeration<URL> getBootstrapResources(String name)
throws IOException
{
final Enumeration<Resource> e =
getBootstrapClassPath().getResources(name);
- return new Enumeration<URL> () {
+ return new Enumeration<> () {
public URL nextElement() {
return e.nextElement().getURL();
}
public boolean hasMoreElements() {
return e.hasMoreElements();
@@ -1865,11 +1865,11 @@
// 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>() {
+ new PrivilegedAction<>() {
public String run() {
try {
return file.exists() ? file.getCanonicalPath() : null;
} catch (IOException e) {
return null;
< prev index next >