changeset 39638:c228d5b513eb

8155770: Correct URLClassLoader API documentation to explicitly say jar-scheme URL's are accepted Reviewed-by: psandoz Contributed-by: steve.drach@oracle.com
author sdrach
date Tue, 12 Jul 2016 11:05:27 -0700
parents 1e670b11a167
children b2d7ac2be69e
files jdk/src/java.base/share/classes/java/net/URLClassLoader.java
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Wed Jul 13 10:26:11 2016 +0800
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Tue Jul 12 11:05:27 2016 -0700
@@ -59,9 +59,11 @@
 
 /**
  * This class loader is used to load classes and resources from a search
- * path of URLs referring to both JAR files and directories. Any URL that
- * ends with a '/' is assumed to refer to a directory. Otherwise, the URL
- * is assumed to refer to a JAR file which will be opened as needed.
+ * path of URLs referring to both JAR files and directories. Any {@code jar:}
+ * scheme URL (see {@link java.net.JarURLConnection}) is assumed to refer to a
+ * JAR file.  Any {@code file:} scheme URL that ends with a '/' is assumed to
+ * refer to a directory. Otherwise, the URL is assumed to refer to a JAR file
+ * which will be opened as needed.
  * <p>
  * The AccessControlContext of the thread that created the instance of
  * URLClassLoader will be used when subsequently loading classes and
@@ -83,9 +85,11 @@
     /**
      * Constructs a new URLClassLoader for the given URLs. The URLs will be
      * searched in the order specified for classes and resources after first
-     * searching in the specified parent class loader. Any URL that ends with
-     * a '/' is assumed to refer to a directory. Otherwise, the URL is assumed
-     * to refer to a JAR file which will be downloaded and opened as needed.
+     * searching in the specified parent class loader.  Any {@code jar:}
+     * scheme URL is assumed to refer to a JAR file.  Any {@code file:} scheme
+     * URL that ends with a '/' is assumed to refer to a directory.  Otherwise,
+     * the URL is assumed to refer to a JAR file which will be downloaded and
+     * opened as needed.
      *
      * <p>If there is a security manager, this method first
      * calls the security manager's {@code checkCreateClassLoader} method