package org.apache.commons.pool.impl
public class GenericObjectPool<T> extends BaseObjectPool<T> implements ObjectPool<T>
/**
* Returns the number of tests to be performed in an Evictor run,
* based on the current value of <code>numTestsPerEvictionRun</code>
* and the number of idle instances in the pool.
*
* @see #setNumTestsPerEvictionRun
* @return the number of tests for the Evictor to run
*/
private int getNumTests() {
if(_numTestsPerEvictionRun >= 0) {
return Math.min(_numTestsPerEvictionRun, _pool.size());
} else {
return(int)(Math.ceil(_pool.size()/Math.abs((double)_numTestsPerEvictionRun)));
}
}