< prev index next >

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

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

@@ -3024,11 +3024,11 @@
         if (SET_COOKIE.equalsIgnoreCase(name) ||
             SET_COOKIE2.equalsIgnoreCase(name)) {
 
             // Filtering only if there is a cookie handler. [Assumption: the
             // cookie handler will store/retrieve the HttpOnly cookies]
-            if (cookieHandler == null || value.length() == 0)
+            if (cookieHandler == null || value.isEmpty())
                 return value;
 
             JavaNetHttpCookieAccess access =
                     SharedSecrets.getJavaNetHttpCookieAccess();
             StringJoiner retValue = new StringJoiner(",");  // RFC 2965, comma separated
< prev index next >