< prev index next >

src/java.base/unix/classes/sun/net/www/protocol/file/Handler.java

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

@@ -73,11 +73,11 @@
     }
 
     public synchronized URLConnection openConnection(URL u, Proxy p)
            throws IOException {
         String host = u.getHost();
-        if (host == null || host.equals("") || host.equals("~") ||
+        if (host == null || host.isEmpty() || host.equals("~") ||
             host.equalsIgnoreCase("localhost")) {
             File file = new File(ParseUtil.decode(u.getPath()));
             return createFileURLConnection(u, file);
         }
 
< prev index next >