src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java
changeset 53018 8bf9268df0e2
parent 47216 71c04702a3d5
child 57956 e0b8b019d2f5
--- a/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Dec 13 16:14:07 2018 +0100
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Dec 13 15:31:05 2018 +0100
@@ -279,7 +279,7 @@
         if (s == null || !s.equals("true"))
             return false;
         String newNonce = p.findValue ("nonce");
-        if (newNonce == null || "".equals(newNonce)) {
+        if (newNonce == null || newNonce.isEmpty()) {
             return false;
         }
         params.setNonce (newNonce);
@@ -323,7 +323,7 @@
                         + authMethod.substring(1).toLowerCase();
         }
         String algorithm = p.findValue("algorithm");
-        if (algorithm == null || "".equals(algorithm)) {
+        if (algorithm == null || algorithm.isEmpty()) {
             algorithm = "MD5";  // The default, accoriding to rfc2069
         }
         params.setAlgorithm (algorithm);
@@ -451,7 +451,7 @@
             }
             /* Check if there is a nextnonce field */
             String nextnonce = p.findValue ("nextnonce");
-            if (nextnonce != null && ! "".equals(nextnonce)) {
+            if (nextnonce != null && !nextnonce.isEmpty()) {
                 params.setNonce (nextnonce);
             }