< prev index next >

src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java

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

@@ -96,17 +96,17 @@
      *                  {@code choices}.
      */
     public ChoiceCallback(String prompt, String[] choices,
                 int defaultChoice, boolean multipleSelectionsAllowed) {
 
-        if (prompt == null || prompt.length() == 0 ||
+        if (prompt == null || prompt.isEmpty() ||
             choices == null || choices.length == 0 ||
             defaultChoice < 0 || defaultChoice >= choices.length)
             throw new IllegalArgumentException();
 
         for (int i = 0; i < choices.length; i++) {
-            if (choices[i] == null || choices[i].length() == 0)
+            if (choices[i] == null || choices[i].isEmpty())
                 throw new IllegalArgumentException();
         }
 
         this.prompt = prompt;
         this.choices = choices;
< prev index next >