< prev index next >

src/java.base/share/classes/jdk/internal/loader/BootLoader.java

Print this page

        

@@ -30,11 +30,10 @@
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.Optional;

@@ -241,12 +240,12 @@
             if (location.startsWith("jrt:/")) {
                 // named module in runtime image ("jrt:/".length() == 5)
                 mn = location.substring(5, location.length());
             } else if (location.startsWith("file:/")) {
                 // named module in exploded image
-                Path path = Paths.get(URI.create(location));
-                Path modulesDir = Paths.get(JAVA_HOME, "modules");
+                Path path = Path.get(URI.create(location));
+                Path modulesDir = Path.get(JAVA_HOME, "modules");
                 if (path.startsWith(modulesDir)) {
                     mn = path.getFileName().toString();
                 }
             }
 

@@ -265,11 +264,11 @@
          * Returns URL if the given location is a regular file path.
          */
         private static URL toFileURL(String location) {
             return AccessController.doPrivileged(new PrivilegedAction<>() {
                 public URL run() {
-                    Path path = Paths.get(location);
+                    Path path = Path.get(location);
                     if (Files.isRegularFile(path)) {
                         try {
                             return path.toUri().toURL();
                         } catch (MalformedURLException e) {}
                     }

@@ -283,11 +282,11 @@
          * containing a manifest.
          */
         private static Manifest getManifest(String location) {
             return AccessController.doPrivileged(new PrivilegedAction<>() {
                 public Manifest run() {
-                    Path jar = Paths.get(location);
+                    Path jar = Path.get(location);
                     try (InputStream in = Files.newInputStream(jar);
                          JarInputStream jis = new JarInputStream(in, false)) {
                         return jis.getManifest();
                     } catch (IOException e) {
                         return null;
< prev index next >