< prev index next >

modules/graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java

Print this page
rev 9717 : 8151320: Remove unnecessary addReads from JavaFX

@@ -51,47 +51,14 @@
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.Base64;
 import com.sun.javafx.jmx.MXExtension;
 import com.sun.javafx.runtime.SystemProperties;
-import com.sun.javafx.util.ModuleHelper;
 
 public class LauncherImpl {
 
     /**
-     * Ensures that the module of the given class is readable to this
-     * module.
-     */
-    private static void ensureReadable(Class<?> targetClass) {
-        if (verbose) {
-            System.err.println("ensureReadable: " + targetClass);
-        }
-        Object thisModule = ModuleHelper.getModule(LauncherImpl.class);
-        Object targetModule = ModuleHelper.getModule(targetClass);
-        ModuleHelper.addReads(thisModule, targetModule);
-    }
-
-    /*
-    private void addExports(ClassLoader targetLoader) {
-        try {
-            Method getModuleMethod = Class.class.getMethod("getModule");
-            Object thisModule = getModuleMethod.invoke(this.getClass());
-            Method getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
-            Object targetModule = getUnnamedModuleMethod.invoke(targetLoader);
-
-            Class<?> moduleClass = getModuleMethod.getReturnType();
-            Method addExportsMethod = moduleClass.getMethod("addExports", String.class, moduleClass);
-            addExportsMethod.invoke(thisModule, "com.sun.tools.doclets.internal.toolkit.taglets", targetModule);
-        } catch (NoSuchMethodException e) {
-            // ignore
-        } catch (Exception e) {
-            throw new InternalError(e);
-        }
-    }
-    */
-
-    /**
      * When passed as launchMode to launchApplication, tells the method that
      * launchName is the name of the JavaFX application class to launch.
      */
     public static final String LAUNCH_MODE_CLASS = "LM_CLASS";
 

@@ -412,11 +379,10 @@
         savedPreloaderClass = preClass;
 
         // If there is a public static void main(String[]) method then call it
         // otherwise just hand off to the other launchApplication method
 
-        ensureReadable(tempAppClass);
         Exception theEx = null;
         try {
             Method mainMethod = tempAppClass.getMethod("main",
                     new Class[] { (new String[0]).getClass() });
             if (verbose) {

@@ -563,11 +529,10 @@
             return;
         }
 
         try {
             Class sm = Class.forName("com.sun.deploy.services.ServiceManager");
-            ensureReadable(sm);
             Class params[] = {Integer.TYPE};
             Method setservice = sm.getDeclaredMethod("setService", params);
             String osname = System.getProperty("os.name");
 
             String servicename;

@@ -722,15 +687,10 @@
                     Thread.currentThread().setContextClassLoader(ccl);
                 });
             }
         }
 
-        if (preloaderClass != null) {
-            ensureReadable(preloaderClass);
-        }
-        ensureReadable(appClass);
-
         final AtomicBoolean pStartCalled = new AtomicBoolean(false);
         final AtomicBoolean startCalled = new AtomicBoolean(false);
         final AtomicBoolean exitCalled = new AtomicBoolean(false);
         final AtomicBoolean pExitCalled = new AtomicBoolean(false);
         final CountDownLatch shutdownLatch = new CountDownLatch(1);
< prev index next >