src/share/classes/sun/misc/Launcher.java

Print this page

        

*** 36,46 **** import java.util.HashSet; import java.util.StringTokenizer; import java.util.Set; import java.util.Vector; import java.security.AccessController; - import java.security.AllPermission; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import java.security.AccessControlContext; import java.security.PermissionCollection; import java.security.Permissions; --- 36,45 ----
*** 115,136 **** */ public ClassLoader getClassLoader() { return loader; } - public static void addURLToAppClassLoader(URL u) { - AccessController.checkPermission(new AllPermission()); - ClassLoader loader = Launcher.getLauncher().getClassLoader(); - ((Launcher.AppClassLoader) loader).addAppURL(u); - } - - public static void addURLToExtClassLoader(URL u) { - AccessController.checkPermission(new AllPermission()); - ClassLoader loader = Launcher.getLauncher().getClassLoader(); - ((Launcher.ExtClassLoader) loader.getParent()).addExtURL(u); - } - /* * The class loader used for loading installed extensions. */ static class ExtClassLoader extends URLClassLoader { --- 114,123 ----
*** 245,259 **** prevDir = dir; } return null; } - protected Class findClass(String name) throws ClassNotFoundException { - BootClassLoaderHook.preLoadClass(name); - return super.findClass(name); - } - private static AccessControlContext getContext(File[] dirs) throws IOException { PathPermissions perms = new PathPermissions(dirs); --- 232,241 ----
*** 314,324 **** * Override loadClass so we can checkPackageAccess. */ public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - BootClassLoaderHook.preLoadClass(name); int i = name.lastIndexOf('.'); if (i != -1) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPackageAccess(name.substring(0, i)); --- 296,305 ----
*** 371,385 **** AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] { domain }); return acc; } - - void addAppURL(URL url) { - super.addURL(url); } - } private static class BootClassPathHolder { static final URLClassPath bcp; static { URL[] urls; --- 352,362 ----
*** 411,425 **** bcp = new URLClassPath(urls, factory); } } public static URLClassPath getBootstrapClassPath() { ! URLClassPath bcp = BootClassPathHolder.bcp; ! // if DownloadManager is installed, return the bootstrap class path ! // maintained by the Java kernel ! BootClassLoaderHook hook = BootClassLoaderHook.getHook(); ! return hook == null ? bcp : hook.getBootstrapClassPath(bcp, factory); } private static URL[] pathToURLs(File[] path) { URL[] urls = new URL[path.length]; for (int i = 0; i < path.length; i++) { --- 388,398 ---- bcp = new URLClassPath(urls, factory); } } public static URLClassPath getBootstrapClassPath() { ! return BootClassPathHolder.bcp; } private static URL[] pathToURLs(File[] path) { URL[] urls = new URL[path.length]; for (int i = 0; i < path.length; i++) {