src/java.base/share/classes/javax/security/auth/callback/NameCallback.java
changeset 53018 8bf9268df0e2
parent 47216 71c04702a3d5
child 57950 4612a3cfb927
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
    60      *
    60      *
    61      * @exception IllegalArgumentException if {@code prompt} is null
    61      * @exception IllegalArgumentException if {@code prompt} is null
    62      *                  or if {@code prompt} has a length of 0.
    62      *                  or if {@code prompt} has a length of 0.
    63      */
    63      */
    64     public NameCallback(String prompt) {
    64     public NameCallback(String prompt) {
    65         if (prompt == null || prompt.length() == 0)
    65         if (prompt == null || prompt.isEmpty())
    66             throw new IllegalArgumentException();
    66             throw new IllegalArgumentException();
    67         this.prompt = prompt;
    67         this.prompt = prompt;
    68     }
    68     }
    69 
    69 
    70     /**
    70     /**
    80      *                  if {@code prompt} has a length of 0,
    80      *                  if {@code prompt} has a length of 0,
    81      *                  if {@code defaultName} is null,
    81      *                  if {@code defaultName} is null,
    82      *                  or if {@code defaultName} has a length of 0.
    82      *                  or if {@code defaultName} has a length of 0.
    83      */
    83      */
    84     public NameCallback(String prompt, String defaultName) {
    84     public NameCallback(String prompt, String defaultName) {
    85         if (prompt == null || prompt.length() == 0 ||
    85         if (prompt == null || prompt.isEmpty() ||
    86             defaultName == null || defaultName.length() == 0)
    86             defaultName == null || defaultName.isEmpty())
    87             throw new IllegalArgumentException();
    87             throw new IllegalArgumentException();
    88 
    88 
    89         this.prompt = prompt;
    89         this.prompt = prompt;
    90         this.defaultName = defaultName;
    90         this.defaultName = defaultName;
    91     }
    91     }