< prev index next >
src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java
Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD
*** 61,71 ****
*
* @exception IllegalArgumentException if {@code prompt} is null
* or if {@code prompt} has a length of 0.
*/
public TextInputCallback(String prompt) {
! if (prompt == null || prompt.length() == 0)
throw new IllegalArgumentException();
this.prompt = prompt;
}
/**
--- 61,71 ----
*
* @exception IllegalArgumentException if {@code prompt} is null
* or if {@code prompt} has a length of 0.
*/
public TextInputCallback(String prompt) {
! if (prompt == null || prompt.isEmpty())
throw new IllegalArgumentException();
this.prompt = prompt;
}
/**
*** 81,92 ****
* if {@code prompt} has a length of 0,
* if {@code defaultText} is null
* or if {@code defaultText} has a length of 0.
*/
public TextInputCallback(String prompt, String defaultText) {
! if (prompt == null || prompt.length() == 0 ||
! defaultText == null || defaultText.length() == 0)
throw new IllegalArgumentException();
this.prompt = prompt;
this.defaultText = defaultText;
}
--- 81,92 ----
* if {@code prompt} has a length of 0,
* if {@code defaultText} is null
* or if {@code defaultText} has a length of 0.
*/
public TextInputCallback(String prompt, String defaultText) {
! if (prompt == null || prompt.isEmpty() ||
! defaultText == null || defaultText.isEmpty())
throw new IllegalArgumentException();
this.prompt = prompt;
this.defaultText = defaultText;
}
< prev index next >