< prev index next >

src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -109,11 +109,11 @@
             /*
              * Consider this a 'file' only if it's a LOCAL file, because
              * 'file:' URLs can be accessible through ftp.
              */
             String host = url.getHost();
-            if (host == null || host.equals("") || host.equals("~") ||
+            if (host == null || host.isEmpty() || host.equals("~") ||
                 host.equalsIgnoreCase("localhost"))
                 return true;
         }
         return false;
     }
< prev index next >