mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
c998ead188
commit
a3df1d618e
155 changed files with 340 additions and 382 deletions
|
@ -62,7 +62,7 @@ public class NameCallback implements Callback, java.io.Serializable {
|
|||
* or if {@code prompt} has a length of 0.
|
||||
*/
|
||||
public NameCallback(String prompt) {
|
||||
if (prompt == null || prompt.length() == 0)
|
||||
if (prompt == null || prompt.isEmpty())
|
||||
throw new IllegalArgumentException();
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ public class NameCallback implements Callback, java.io.Serializable {
|
|||
* or if {@code defaultName} has a length of 0.
|
||||
*/
|
||||
public NameCallback(String prompt, String defaultName) {
|
||||
if (prompt == null || prompt.length() == 0 ||
|
||||
defaultName == null || defaultName.length() == 0)
|
||||
if (prompt == null || prompt.isEmpty() ||
|
||||
defaultName == null || defaultName.isEmpty())
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
this.prompt = prompt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue