--- old/src/java.base/unix/classes/jdk/internal/loader/FileURLMapper.java 2019-01-04 10:01:57.086537099 -0800 +++ new/src/java.base/unix/classes/jdk/internal/loader/FileURLMapper.java 2019-01-04 10:01:56.766537363 -0800 @@ -30,22 +30,21 @@ import sun.net.www.ParseUtil; /** - * (Solaris) platform specific handling for file: URLs . - * urls must not contain a hostname in the authority field + * (Unix) platform specific handling for file: URLs . + * URLs must not contain a hostname in the authority field * other than "localhost". * * This implementation could be updated to map such URLs - * on to /net/host/... + * on to /net/host/... on system using such an automounter map. * * @author Michael McMahon */ public class FileURLMapper { - - URL url; + final URL url; String path; - public FileURLMapper (URL url) { + public FileURLMapper(URL url) { this.url = url; } @@ -53,8 +52,7 @@ * @return the platform specific path corresponding to the URL * so long as the URL does not contain a hostname in the authority field. */ - - public String getPath () { + public String getPath() { if (path != null) { return path; } @@ -69,13 +67,8 @@ /** * Checks whether the file identified by the URL exists. */ - public boolean exists () { - String s = getPath (); - if (s == null) { - return false; - } else { - File f = new File (s); - return f.exists(); - } + public boolean exists() { + String s = getPath(); + return s != null && new File(s).exists(); } }