You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/06/03 15:15:41 UTC
svn commit: r1599533 -
/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
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));