hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1440520 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Date Wed, 30 Jan 2013 16:59:21 GMT
Author: olegk
Date: Wed Jan 30 16:59:20 2013
New Revision: 1440520

URL: http://svn.apache.org/viewvc?rev=1440520&view=rev
Log:
HTTPCLIENT-1313: Fixed IllegalStateException in deprecated ThreadSafeClientConnManager

Modified:
    httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1440520&r1=1440519&r2=1440520&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Wed Jan 30 16:59:20 2013
@@ -1,6 +1,9 @@
 Changes since 4.3 ALPHA1
 -------------------
 
+* [HTTPCLIENT-1313] Fixed IllegalStateException in deprecated ThreadSafeClientConnManager
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1305] Ensure chunking is disabled when applying Base64 encoding.
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java?rev=1440520&r1=1440519&r2=1440520&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
Wed Jan 30 16:59:20 2013
@@ -129,8 +129,9 @@ public abstract class AbstractPoolEntry 
 
         Args.notNull(route, "Route");
         Args.notNull(params, "HTTP parameters");
-        Asserts.notNull(this.tracker, "Route tracker");
-        Asserts.check(!this.tracker.isConnected(), "Connection already open");
+        if (this.tracker != null) {
+            Asserts.check(!this.tracker.isConnected(), "Connection already open");
+        }
         // - collect the arguments
         // - call the operator
         // - update the tracking data

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?rev=1440520&r1=1440519&r2=1440520&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Wed Jan 30 16:59:20 2013
@@ -42,7 +42,7 @@ import org.apache.http.conn.params.ConnP
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.impl.conn.DefaultClientConnectionOperator;
-import org.apache.http.impl.conn.PoolingClientConnectionManager;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.SchemeRegistryFactory;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
@@ -66,7 +66,7 @@ import org.apache.http.util.Asserts;
  *
  * @since 4.0
  *
- * @deprecated (4.2)  use {@link PoolingClientConnectionManager}
+ * @deprecated (4.2)  use {@link PoolingHttpClientConnectionManager}
  */
 @ThreadSafe
 @Deprecated
@@ -249,8 +249,9 @@ public class ThreadSafeClientConnManager
         Args.check(conn instanceof BasicPooledConnAdapter, "Connection class mismatch, "
+
                 "connection not obtained from this manager");
         final BasicPooledConnAdapter hca = (BasicPooledConnAdapter) conn;
-        Asserts.check(hca.getPoolEntry() == null, "Connection not obtained from this manager");
-        Asserts.check(hca.getManager() == this, "Connection not obtained from this manager");
+        if (hca.getPoolEntry() != null) {
+            Asserts.check(hca.getManager() == this, "Connection not obtained from this manager");
+        }
         synchronized (hca) {
             final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry();
             if (entry == null) {



Mime
View raw message