Replace 'String.length() == 0' with 'String.isEmpty()'

See gh-8103
This commit is contained in:
Johnny Lim
2017-01-25 09:50:31 +09:00
committed by Stephane Nicoll
parent 79233b019e
commit 32f9e90de5
9 changed files with 11 additions and 11 deletions

View File

@@ -121,7 +121,7 @@ final class AsciiBytes {
}
public AsciiBytes append(String string) {
if (string == null || string.length() == 0) {
if (string == null || string.isEmpty()) {
return this;
}
return append(string.getBytes(UTF_8));

View File

@@ -293,7 +293,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
private String decode(String source) {
if (source.length() == 0 || (source.indexOf('%') < 0)) {
if (source.isEmpty() || (source.indexOf('%') < 0)) {
return source;
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(source.length());
@@ -347,7 +347,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
public boolean isEmpty() {
return this.name.length() == 0;
return this.name.isEmpty();
}
public String getContentType() {