jdk/src/share/classes/sun/misc/Launcher.java
changeset 10419 12c063b39232
parent 9035 1255eb81cc2f
child 11117 b6e68b1344d4
equal deleted inserted replaced
10418:1d57022fdb6e 10419:12c063b39232
    69         ClassLoader extcl;
    69         ClassLoader extcl;
    70         try {
    70         try {
    71             extcl = ExtClassLoader.getExtClassLoader();
    71             extcl = ExtClassLoader.getExtClassLoader();
    72         } catch (IOException e) {
    72         } catch (IOException e) {
    73             throw new InternalError(
    73             throw new InternalError(
    74                 "Could not create extension class loader");
    74                 "Could not create extension class loader", e);
    75         }
    75         }
    76 
    76 
    77         // Now create the class loader to use to launch the application
    77         // Now create the class loader to use to launch the application
    78         try {
    78         try {
    79             loader = AppClassLoader.getAppClassLoader(extcl);
    79             loader = AppClassLoader.getAppClassLoader(extcl);
    80         } catch (IOException e) {
    80         } catch (IOException e) {
    81             throw new InternalError(
    81             throw new InternalError(
    82                 "Could not create application class loader");
    82                 "Could not create application class loader", e);
    83         }
    83         }
    84 
    84 
    85         // Also set the context class loader for the primordial thread.
    85         // Also set the context class loader for the primordial thread.
    86         Thread.currentThread().setContextClassLoader(loader);
    86         Thread.currentThread().setContextClassLoader(loader);
    87 
    87 
   458 
   458 
   459         try {
   459         try {
   460             return ParseUtil.fileToEncodedURL(file);
   460             return ParseUtil.fileToEncodedURL(file);
   461         } catch (MalformedURLException e) {
   461         } catch (MalformedURLException e) {
   462             // Should never happen since we specify the protocol...
   462             // Should never happen since we specify the protocol...
   463             throw new InternalError();
   463             throw new InternalError(e);
   464         }
   464         }
   465     }
   465     }
   466 
   466 
   467     /*
   467     /*
   468      * The stream handler factory for loading system protocol handlers.
   468      * The stream handler factory for loading system protocol handlers.
   473         public URLStreamHandler createURLStreamHandler(String protocol) {
   473         public URLStreamHandler createURLStreamHandler(String protocol) {
   474             String name = PREFIX + "." + protocol + ".Handler";
   474             String name = PREFIX + "." + protocol + ".Handler";
   475             try {
   475             try {
   476                 Class c = Class.forName(name);
   476                 Class c = Class.forName(name);
   477                 return (URLStreamHandler)c.newInstance();
   477                 return (URLStreamHandler)c.newInstance();
   478             } catch (ClassNotFoundException e) {
   478             } catch (ReflectiveOperationException e) {
   479                 e.printStackTrace();
   479                 throw new InternalError("could not load " + protocol +
   480             } catch (InstantiationException e) {
   480                                         "system protocol handler", e);
   481                 e.printStackTrace();
   481             }
   482             } catch (IllegalAccessException e) {
       
   483                 e.printStackTrace();
       
   484             }
       
   485             throw new InternalError("could not load " + protocol +
       
   486                                     "system protocol handler");
       
   487         }
   482         }
   488     }
   483     }
   489 }
   484 }
   490 
   485 
   491 class PathPermissions extends PermissionCollection {
   486 class PathPermissions extends PermissionCollection {