hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1599533 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
Date Tue, 03 Jun 2014 13:15:41 GMT
Author: olegk
Date: Tue Jun  3 13:15:40 2014
New Revision: 1599533

URL: http://svn.apache.org/r1599533
Log:
HTTPCLIENT-1504: do not allow zero total max and max per route settings (also consistent with
the behaviour of AbstractNIOConnPool)

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java?rev=1599533&r1=1599532&r2=1599533&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
Tue Jun  3 13:15:40 2014
@@ -83,8 +83,8 @@ public abstract class AbstractConnPool<T
             final int maxTotal) {
         super();
         this.connFactory = Args.notNull(connFactory, "Connection factory");
-        this.defaultMaxPerRoute = Args.notNegative(defaultMaxPerRoute, "Max per route value");
-        this.maxTotal = Args.notNegative(maxTotal, "Max total value");
+        this.defaultMaxPerRoute = Args.positive(defaultMaxPerRoute, "Max per route value");
+        this.maxTotal = Args.positive(maxTotal, "Max total value");
         this.lock = new ReentrantLock();
         this.routeToPool = new HashMap<T, RouteSpecificPool<T, C, E>>();
         this.leased = new HashSet<E>();
@@ -355,7 +355,7 @@ public abstract class AbstractConnPool<T
 
     @Override
     public void setMaxTotal(final int max) {
-        Args.notNegative(max, "Max value");
+        Args.positive(max, "Max value");
         this.lock.lock();
         try {
             this.maxTotal = max;
@@ -376,7 +376,7 @@ public abstract class AbstractConnPool<T
 
     @Override
     public void setDefaultMaxPerRoute(final int max) {
-        Args.notNegative(max, "Max per route value");
+        Args.positive(max, "Max per route value");
         this.lock.lock();
         try {
             this.defaultMaxPerRoute = max;
@@ -398,7 +398,7 @@ public abstract class AbstractConnPool<T
     @Override
     public void setMaxPerRoute(final T route, final int max) {
         Args.notNull(route, "Route");
-        Args.notNegative(max, "Max per route value");
+        Args.positive(max, "Max per route value");
         this.lock.lock();
         try {
             this.maxPerRoute.put(route, Integer.valueOf(max));



Mime
View raw message