hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [2/3] httpcomponents-client git commit: [HTTPCLIENT-1858] Clone some code from Log4j 2 to cache a StringBuilder in a ThreadLocal. Update to use the StringBuilder's capacity instead of its length to measure upper bound.
Date Tue, 01 Aug 2017 17:28:51 GMT
[HTTPCLIENT-1858] Clone some code from Log4j 2 to cache a StringBuilder
in a ThreadLocal. Update to use the StringBuilder's capacity instead of
its length to measure upper bound.

Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/f2146cab
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/f2146cab
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/f2146cab

Branch: refs/heads/master
Commit: f2146cab622b63ff69a005040635c14fed509e54
Parents: fe6b90a
Author: Gary Gregory <ggregory@apache.org>
Authored: Tue Jul 25 15:25:20 2017 -0700
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Tue Aug 1 19:12:15 2017 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/hc/client5/http/impl/logging/Wire.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/f2146cab/httpclient5/src/main/java/org/apache/hc/client5/http/impl/logging/Wire.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/logging/Wire.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/logging/Wire.java
index e6b09b1..8bd9e4f 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/logging/Wire.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/logging/Wire.java
@@ -64,7 +64,7 @@ class Wire {
      */
     // TODO Delete wheb Log4j's 2.9 (see #trimToMaxSize(StringBuild))
     private static void trimToMaxSize(final StringBuilder stringBuilder, final int maxSize)
{
-        if (stringBuilder != null && stringBuilder.length() > maxSize) {
+        if (stringBuilder != null && stringBuilder.capacity() > maxSize) {
             stringBuilder.setLength(maxSize);
             stringBuilder.trimToSize();
         }


Mime
View raw message