< prev index next >

src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()

@@ -74,11 +74,11 @@
     JarFile get(URL url, boolean useCaches) throws IOException {
         if (url.getProtocol().equalsIgnoreCase("file")) {
             // Deal with UNC pathnames specially. See 4180841
 
             String host = url.getHost();
-            if (host != null && !host.equals("") &&
+            if (host != null && !host.isEmpty() &&
                 !host.equalsIgnoreCase("localhost")) {
 
                 url = new URL("file", "", "//" + host + url.getPath());
             }
         }
< prev index next >