You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by mi...@apache.org on 2019/01/02 11:22:34 UTC

[httpcomponents-core] branch HTTPCORE-565_4.4.x created (now 347bf6c)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch HTTPCORE-565_4.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git.


      at 347bf6c  [HTTPCORE-565] org.apache.http.pool.AbstractConnPool#toString() throws ConcurrentModificationException

This branch includes the following new commits:

     new 347bf6c  [HTTPCORE-565] org.apache.http.pool.AbstractConnPool#toString() throws ConcurrentModificationException

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[httpcomponents-core] 01/01: [HTTPCORE-565] org.apache.http.pool.AbstractConnPool#toString() throws ConcurrentModificationException

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch HTTPCORE-565_4.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 347bf6c16113b44ad1af2d387bbd2ec291094e9d
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jan 2 12:22:23 2019 +0100

    [HTTPCORE-565] org.apache.http.pool.AbstractConnPool#toString() throws ConcurrentModificationException
---
 .../org/apache/http/pool/AbstractConnPool.java     | 23 +++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java b/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
index 14c6290..c48ab99 100644
--- a/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
+++ b/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
@@ -661,15 +661,20 @@ public abstract class AbstractConnPool<T, C, E extends PoolEntry<T, C>>
 
     @Override
     public String toString() {
-        final StringBuilder buffer = new StringBuilder();
-        buffer.append("[leased: ");
-        buffer.append(this.leased);
-        buffer.append("][available: ");
-        buffer.append(this.available);
-        buffer.append("][pending: ");
-        buffer.append(this.pending);
-        buffer.append("]");
-        return buffer.toString();
+        this.lock.lock();
+        try {
+            final StringBuilder buffer = new StringBuilder();
+            buffer.append("[leased: ");
+            buffer.append(this.leased);
+            buffer.append("][available: ");
+            buffer.append(this.available);
+            buffer.append("][pending: ");
+            buffer.append(this.pending);
+            buffer.append("]");
+            return buffer.toString();
+        } finally {
+            this.lock.unlock();
+        }
     }
 
 }