8200125: Fix some classloader/module typos
authormartin
Thu, 05 Apr 2018 09:33:27 -0700
changeset 49528 c1eb35eb5f38
parent 49527 5aa40f834b50
child 49529 c0bdb1b1ab4f
8200125: Fix some classloader/module typos Reviewed-by: alanb
src/java.base/share/classes/java/lang/ClassLoader.java
src/java.base/share/classes/java/lang/ModuleLayer.java
src/java.base/share/classes/java/net/URL.java
src/java.base/share/classes/java/net/URLClassLoader.java
src/java.base/share/classes/jdk/internal/loader/BootLoader.java
src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
src/java.base/share/classes/jdk/internal/loader/Loader.java
src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Thu Apr 05 09:33:27 2018 -0700
@@ -699,7 +699,7 @@
     /**
      * Finds the class with the given <a href="#binary-name">binary name</a>
      * in a module defined to this class loader.
-     * Class loader implementations that support the loading from modules
+     * Class loader implementations that support loading from modules
      * should override this method.
      *
      * @apiNote This method returns {@code null} rather than throwing
@@ -1281,7 +1281,7 @@
 
     /**
      * Returns a URL to a resource in a module defined to this class loader.
-     * Class loader implementations that support the loading from modules
+     * Class loader implementations that support loading from modules
      * should override this method.
      *
      * @apiNote This method is the basis for the {@link
@@ -1417,12 +1417,12 @@
      * @param  name
      *         The resource name
      *
-     * @return  An enumeration of {@link java.net.URL URL} objects for
-     *          the resource. If no resources could  be found, the enumeration
-     *          will be empty. Resources for which a {@code URL} cannot be
-     *          constructed, are in package that is not opened unconditionally,
-     *          or access to the resource is denied by the security manager,
-     *          are not returned in the enumeration.
+     * @return  An enumeration of {@link java.net.URL URL} objects for the
+     *          resource. If no resources could be found, the enumeration will
+     *          be empty. Resources for which a {@code URL} cannot be
+     *          constructed, are in a package that is not opened
+     *          unconditionally, or access to the resource is denied by the
+     *          security manager, are not returned in the enumeration.
      *
      * @throws  IOException
      *          If I/O errors occur
--- a/src/java.base/share/classes/java/lang/ModuleLayer.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/java/lang/ModuleLayer.java	Thu Apr 05 09:33:27 2018 -0700
@@ -152,7 +152,7 @@
     private static final ModuleLayer EMPTY_LAYER
         = new ModuleLayer(Configuration.empty(), List.of(), null);
 
-    // the configuration from which this ;ayer was created
+    // the configuration from which this layer was created
     private final Configuration cf;
 
     // parent layers, empty in the case of the empty layer
@@ -498,7 +498,7 @@
         try {
             Loader loader = new Loader(cf.modules(), parentLoader);
             loader.initRemotePackageMap(cf, parents);
-            ModuleLayer layer =  new ModuleLayer(cf, parents, mn -> loader);
+            ModuleLayer layer = new ModuleLayer(cf, parents, mn -> loader);
             return new Controller(layer);
         } catch (IllegalArgumentException | IllegalStateException e) {
             throw new LayerInstantiationException(e.getMessage());
--- a/src/java.base/share/classes/java/net/URL.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/java/net/URL.java	Thu Apr 05 09:33:27 2018 -0700
@@ -1411,7 +1411,7 @@
                 // Check with factory if another thread set a
                 // factory since our last check
                 if (!checkedWithFactory && (fac = factory) != null) {
-                    handler2 =  fac.createURLStreamHandler(protocol);
+                    handler2 = fac.createURLStreamHandler(protocol);
                 }
 
                 if (handler2 != null) {
--- a/src/java.base/share/classes/java/net/URLClassLoader.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java	Thu Apr 05 09:33:27 2018 -0700
@@ -764,7 +764,7 @@
             path = ParseUtil.decode(path);
             if (path.endsWith(File.separator))
                 path += "-";
-            p =  new FilePermission(path, SecurityConstants.FILE_READ_ACTION);
+            p = new FilePermission(path, SecurityConstants.FILE_READ_ACTION);
         } else {
             /**
              * Not loading from a 'file:' URL so we want to give the class
--- a/src/java.base/share/classes/jdk/internal/loader/BootLoader.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/loader/BootLoader.java	Thu Apr 05 09:33:27 2018 -0700
@@ -100,8 +100,8 @@
     }
 
     /**
-     * Register a module with this class loader so that its classes (and
-     * resources) become visible via this class loader.
+     * Registers a module with this class loader so that its classes
+     * (and resources) become visible via this class loader.
      */
     public static void loadModule(ModuleReference mref) {
         ClassLoaders.bootLoader().loadModule(mref);
--- a/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java	Thu Apr 05 09:33:27 2018 -0700
@@ -584,7 +584,7 @@
     }
 
     /**
-     * A variation of {@code loadCass} to load a class with the specified
+     * A variation of {@code loadClass} to load a class with the specified
      * binary name. This method returns {@code null} when the class is not
      * found.
      */
@@ -633,16 +633,16 @@
     }
 
     /**
-     * A variation of {@code loadCass} to load a class with the specified
+     * A variation of {@code loadClass} to load a class with the specified
      * binary name. This method returns {@code null} when the class is not
      * found.
      */
-    protected  Class<?> loadClassOrNull(String cn) {
+    protected Class<?> loadClassOrNull(String cn) {
         return loadClassOrNull(cn, false);
     }
 
     /**
-     * Find the candidate loaded module for the given class name.
+     * Finds the candidate loaded module for the given class name.
      * Returns {@code null} if none of the modules defined to this
      * class loader contain the API package for the class.
      */
@@ -656,7 +656,7 @@
     }
 
     /**
-     * Find the candidate loaded module for the given class name
+     * Finds the candidate loaded module for the given class name
      * in the named module.  Returns {@code null} if the named module
      * is not defined to this class loader or does not contain
      * the API package for the class.
@@ -832,8 +832,8 @@
     }
 
     /**
-     * Get the Package with the specified package name. If defined
-     * then verify that it against the manifest and code source.
+     * Gets the Package with the specified package name. If defined
+     * then verifies it against the manifest and code source.
      *
      * @throws SecurityException if there is a sealing violation (JAR spec)
      */
@@ -859,7 +859,7 @@
 
     /**
      * Defines a new package in this ClassLoader. The attributes in the specified
-     * Manifest are use to get the package version and sealing information.
+     * Manifest are used to get the package version and sealing information.
      *
      * @throws IllegalArgumentException if the package name duplicates an
      * existing package either in this class loader or one of its ancestors
@@ -976,7 +976,7 @@
     // -- miscellaneous supporting methods
 
     /**
-     * Returns the ModuleReader for the given module, creating it if needed
+     * Returns the ModuleReader for the given module, creating it if needed.
      */
     private ModuleReader moduleReaderFor(ModuleReference mref) {
         ModuleReader reader = moduleToReader.get(mref);
--- a/src/java.base/share/classes/jdk/internal/loader/Loader.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/loader/Loader.java	Thu Apr 05 09:33:27 2018 -0700
@@ -90,7 +90,7 @@
         ClassLoader.registerAsParallelCapable();
     }
 
-    // the loader pool is in a pool, can be null
+    // the pool this loader is a member of; can be null
     private final LoaderPool pool;
 
     // parent ClassLoader, can be null
@@ -487,7 +487,7 @@
     }
 
     /**
-     * Finds the class with the specified binary name in a given module.
+     * Finds the class with the specified binary name in the given module.
      * This method returns {@code null} if the class cannot be found.
      */
     @Override
--- a/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java	Thu Apr 05 15:04:09 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java	Thu Apr 05 09:33:27 2018 -0700
@@ -173,7 +173,7 @@
         }
 
         /**
-         * Traverse this graph and performs the given action in topological order
+         * Traverses this graph and performs the given action in topological order.
          */
         public void ordered(Consumer<T> action) {
             TopoSorter<T> sorter = new TopoSorter<>(this);
@@ -181,7 +181,7 @@
         }
 
         /**
-         * Traverses this graph and performs the given action in reverse topological order
+         * Traverses this graph and performs the given action in reverse topological order.
          */
         public void reverse(Consumer<T> action) {
             TopoSorter<T> sorter = new TopoSorter<>(this);
@@ -189,7 +189,7 @@
         }
 
         /**
-         * Returns a transposed graph from this graph
+         * Returns a transposed graph from this graph.
          */
         public Graph<T> transpose() {
             Builder<T> builder = new Builder<>();