You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2018/07/12 15:04:48 UTC
httpcomponents-client git commit: Use "String.isEmpty()" instead of
"String.length() == 0"
Repository: httpcomponents-client
Updated Branches:
refs/heads/4.5.x c72ccfaba -> 8c3333b4d
Use "String.isEmpty()" instead of "String.length() == 0"
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/8c3333b4
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/8c3333b4
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/8c3333b4
Branch: refs/heads/4.5.x
Commit: 8c3333b4d53ba423c5f98df1ddf8bf85d3923bfc
Parents: c72ccfa
Author: Gary Gregory <ga...@gmail.com>
Authored: Thu Jul 12 09:04:46 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Thu Jul 12 09:04:46 2018 -0600
----------------------------------------------------------------------
.../main/java/org/apache/http/client/utils/URLEncodedUtils.java | 2 +-
.../main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/8c3333b4/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
index cc9066a..d85cf8d 100644
--- a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
+++ b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
@@ -141,7 +141,7 @@ public class URLEncodedUtils {
} finally {
instream.close();
}
- if (buf.length() == 0) {
+ if (buf.isEmpty()) {
return createEmptyList();
}
return parse(buf, charset, QP_SEP_A);
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/8c3333b4/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
index 7368dcf..d179011 100644
--- a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
+++ b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
@@ -130,7 +130,7 @@ public class RFC6265CookieSpec implements CookieSpec {
cursor = new ParserCursor(0, buffer.length());
}
final String name = tokenParser.parseToken(buffer, cursor, TOKEN_DELIMS);
- if (name.length() == 0) {
+ if (name.isEmpty()) {
return Collections.emptyList();
}
if (cursor.atEnd()) {