changeset 19500:466e5efca25b

JavaLangAccess.findResource can be removed
author alanb
date Wed, 12 Apr 2017 19:26:23 +0100
parents 222e1d0b5f91
children 5c7ca298a92a
files src/java.base/share/classes/java/lang/Module.java src/java.base/share/classes/java/lang/System.java src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
diffstat 3 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Module.java	Wed Apr 12 14:46:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/Module.java	Wed Apr 12 19:26:23 2017 +0100
@@ -1521,8 +1521,7 @@
         }
 
         // locate resource in module
-        JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
-        URL url = jla.findResource(loader, mn, name);
+        URL url = loader.findResource(mn, name);
         if (url != null) {
             try {
                 return url.openStream();
--- a/src/java.base/share/classes/java/lang/System.java	Wed Apr 12 14:46:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/System.java	Wed Apr 12 19:26:23 2017 +0100
@@ -41,7 +41,6 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.net.URI;
-import java.net.URL;
 import java.security.AccessControlContext;
 import java.security.ProtectionDomain;
 import java.security.AccessController;
@@ -2110,9 +2109,6 @@
             public Class<?> findBootstrapClassOrNull(ClassLoader cl, String name) {
                 return cl.findBootstrapClassOrNull(name);
             }
-            public URL findResource(ClassLoader cl, String mn, String name) throws IOException {
-                return cl.findResource(mn, name);
-            }
             public Stream<Package> packages(ClassLoader cl) {
                 return cl.packages();
             }
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Wed Apr 12 14:46:58 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Wed Apr 12 19:26:23 2017 +0100
@@ -25,13 +25,11 @@
 
 package jdk.internal.misc;
 
-import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.net.URI;
-import java.net.URL;
 import java.security.AccessControlContext;
 import java.security.ProtectionDomain;
 import java.util.Map;
@@ -157,12 +155,6 @@
     Class<?> findBootstrapClassOrNull(ClassLoader cl, String name);
 
     /**
-     * Returns a URL to a resource with the given name in a module that is
-     * defined to the given class loader.
-     */
-    URL findResource(ClassLoader cl, String moduleName, String name) throws IOException;
-
-    /**
      * Returns the Packages for the given class loader.
      */
     Stream<Package> packages(ClassLoader cl);