changeset 15510:2fe9d4061c0c

Revert uses of addReads in java.rmi module
author alanb
date Wed, 02 Mar 2016 16:45:17 +0000
parents 1b9780bce9d3
children becadcb5a0ee
files src/java.rmi/share/classes/java/rmi/activation/ActivationGroup.java src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java src/java.rmi/share/classes/sun/rmi/server/Activation.java src/java.rmi/share/classes/sun/rmi/server/ActivationGroupImpl.java src/java.rmi/share/classes/sun/rmi/server/UnicastServerRef.java src/java.rmi/share/classes/sun/rmi/server/Util.java
diffstat 7 files changed, 1 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.rmi/share/classes/java/rmi/activation/ActivationGroup.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/java/rmi/activation/ActivationGroup.java	Wed Mar 02 16:45:17 2016 +0000
@@ -27,7 +27,6 @@
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
 import java.rmi.MarshalledObject;
 import java.rmi.Naming;
 import java.rmi.Remote;
@@ -319,9 +318,6 @@
                 }
             }
 
-            // Ensure module containing group class is readable
-            ActivationGroup.class.getModule().addReads(cl.getModule());
-
             // create group
             Constructor<? extends ActivationGroup> constructor =
                 cl.getConstructor(ActivationGroupID.class,
--- a/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java	Wed Mar 02 16:45:17 2016 +0000
@@ -681,7 +681,6 @@
                     Class.forName(providerClassName, false,
                                   ClassLoader.getSystemClassLoader())
                     .asSubclass(RMIClassLoaderSpi.class);
-                RMIClassLoader.class.getModule().addReads(providerClass.getModule());
                 return providerClass.newInstance();
 
             } catch (ClassNotFoundException e) {
--- a/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java	Wed Mar 02 16:45:17 2016 +0000
@@ -344,7 +344,6 @@
                         });
                 Class<? extends LogFile> cl =
                     loader.loadClass(logClassName).asSubclass(LogFile.class);
-                ReliableLog.class.getModule().addReads(cl.getModule());
                 return cl.getConstructor(String.class, String.class);
             } catch (Exception e) {
                 System.err.println("Exception occurred:");
--- a/src/java.rmi/share/classes/sun/rmi/server/Activation.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/sun/rmi/server/Activation.java	Wed Mar 02 16:45:17 2016 +0000
@@ -2066,7 +2066,6 @@
 
                 try {
                     Class<?> execPolicyClass = getRMIClass(execPolicyClassName);
-                    Activation.class.getModule().addReads(execPolicyClass.getModule());
                     execPolicy = execPolicyClass.newInstance();
                     execPolicyMethod =
                         execPolicyClass.getMethod("checkExecCommand",
--- a/src/java.rmi/share/classes/sun/rmi/server/ActivationGroupImpl.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/sun/rmi/server/ActivationGroupImpl.java	Wed Mar 02 16:45:17 2016 +0000
@@ -257,7 +257,6 @@
                           Constructor<? extends Remote> constructor =
                               cl.getDeclaredConstructor(
                                   ActivationID.class, MarshalledObject.class);
-                          this.getClass().getModule().addReads(cl.getModule());
                           constructor.setAccessible(true);
                           try {
                               /*
--- a/src/java.rmi/share/classes/sun/rmi/server/UnicastServerRef.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/sun/rmi/server/UnicastServerRef.java	Wed Mar 02 16:45:17 2016 +0000
@@ -553,8 +553,6 @@
                             AccessController.doPrivileged(
                                 new PrivilegedAction<Void>() {
                                 public Void run() {
-                                    this.getClass().getModule()
-                                        .addReads(m.getDeclaringClass().getModule());
                                     m.setAccessible(true);
                                     return null;
                                 }
--- a/src/java.rmi/share/classes/sun/rmi/server/Util.java	Wed Mar 02 15:39:38 2016 +0000
+++ b/src/java.rmi/share/classes/sun/rmi/server/Util.java	Wed Mar 02 16:45:17 2016 +0000
@@ -32,7 +32,6 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 import java.rmi.StubNotFoundException;
@@ -286,16 +285,11 @@
          * pickle methods
          */
         try {
-            AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                public Void run() {
-                    Module stubModule = remoteClass.getModule();
-                    Remote.class.getModule().addReads(stubModule);
-                    return null;
-                }});
             Class<?> stubcl =
                 Class.forName(stubname, false, remoteClass.getClassLoader());
             Constructor<?> cons = stubcl.getConstructor(stubConsParamTypes);
             return (RemoteStub) cons.newInstance(new Object[] { ref });
+
         } catch (ClassNotFoundException e) {
             throw new StubNotFoundException(
                 "Stub class not found: " + stubname, e);