Replace 'String.length() == 0' with 'String.isEmpty()'
See gh-8103
This commit is contained in:
committed by
Stephane Nicoll
parent
79233b019e
commit
32f9e90de5
@@ -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));
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user