changeset 19424:3af7c5be720d

Post move clean-up
author alanb
date Tue, 28 Mar 2017 14:20:31 +0100
parents 1251fd9753f0
children b2150781ba2e
files src/java.base/share/classes/java/lang/Module.java src/java.base/share/classes/java/lang/ModuleLayer.java src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
diffstat 3 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Module.java	Tue Mar 28 13:27:42 2017 +0100
+++ b/src/java.base/share/classes/java/lang/Module.java	Tue Mar 28 14:20:31 2017 +0100
@@ -225,7 +225,7 @@
      * named modules that are generated at runtime. A dynamic module may or may
      * not be in a module layer. </p>
      *
-     * @return The layer that contains this module
+     * @return The module layer that contains this module
      *
      * @see java.lang.reflect.Proxy
      */
@@ -380,6 +380,7 @@
      * If {@code syncVM} is {@code true} then the VM is notified.
      */
     private void implAddReads(Module other, boolean syncVM) {
+        Objects.requireNonNull(other);
         if (!canRead(other)) {
             // update VM first, just in case it fails
             if (syncVM) {
--- a/src/java.base/share/classes/java/lang/ModuleLayer.java	Tue Mar 28 13:27:42 2017 +0100
+++ b/src/java.base/share/classes/java/lang/ModuleLayer.java	Tue Mar 28 14:20:31 2017 +0100
@@ -47,7 +47,6 @@
 import jdk.internal.loader.ClassLoaderValue;
 import jdk.internal.loader.Loader;
 import jdk.internal.loader.LoaderPool;
-import jdk.internal.misc.SharedSecrets;
 import jdk.internal.module.ServicesCatalog;
 import sun.security.util.SecurityConstants;
 
@@ -241,7 +240,6 @@
          */
         public Controller addReads(Module source, Module target) {
             ensureInLayer(source);
-            Objects.requireNonNull(target);
             source.implAddReads(target);
             return this;
         }
@@ -267,8 +265,7 @@
          * @see Module#addOpens
          */
         public Controller addOpens(Module source, String pn, Module target) {
-            Objects.requireNonNull(pn);
-            Objects.requireNonNull(target);
+            ensureInLayer(source);
             source.implAddOpens(pn, target);
             return this;
         }
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Tue Mar 28 13:27:42 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Tue Mar 28 14:20:31 2017 +0100
@@ -191,7 +191,7 @@
     Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
 
     /**
-     * ??
+     * Defines the unnamed module for the given class loader.
      */
     Module defineUnnamedModule(ClassLoader loader);