< prev index next >

src/java.base/share/classes/java/net/URLClassLoader.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -741,11 +741,11 @@
             URL locUrl = url;
             if (urlConnection instanceof JarURLConnection) {
                 locUrl = ((JarURLConnection)urlConnection).getJarFileURL();
             }
             String host = locUrl.getHost();
-            if (host != null && (host.length() > 0))
+            if (host != null && !host.isEmpty())
                 p = new SocketPermission(host,
                                          SecurityConstants.SOCKET_CONNECT_ACCEPT_ACTION);
         }
 
         // make sure the person that created this class loader
< prev index next >