< prev index next >

src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb

@@ -246,11 +246,11 @@
             this.port = url.getDefaultPort();
         }
         this.realm = realm;
 
         String urlPath = url.getPath();
-        if (urlPath.length() == 0)
+        if (urlPath.isEmpty())
             this.path = urlPath;
         else {
             this.path = reducePath (urlPath);
         }
         this.authenticatorKey = Objects.requireNonNull(authenticatorKey);
< prev index next >