Author: markt
Date: Mon Feb 13 23:11:00 2012
New Revision: 1243731
URL: http://svn.apache.org/viewvc?rev=1243731&view=rev
Log:
Remove trailing whitespace. No functional change.
Modified:
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Modified:
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=1243731&r1=1243730&r2=1243731&view=diff
==============================================================================
---
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
(original)
+++
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
Mon Feb 13 23:11:00 2012
@@ -193,10 +193,10 @@ import org.apache.commons.pool.PoolUtils
* ensure that no call to a factory method will occur within a synchronization
* block. See POOL-125 and DBCP-44 for more information.
* </p>
- *
+ *
* @param <K> the type of keys in this pool
* @param <V> the type of objects held in this pool
- *
+ *
* @see GenericObjectPool
* @author Rodney Waldhoff
* @author Dirk Verbeeck
@@ -361,7 +361,7 @@ public class GenericKeyedObjectPool<K, V
* @see #setFactory(KeyedPoolableObjectFactory)
*/
public GenericKeyedObjectPool() {
- this(null, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION,
DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
+ this(null, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION,
DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
}
@@ -397,7 +397,7 @@ public class GenericKeyedObjectPool<K, V
*/
public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory,
int maxActive) {
this(factory,maxActive, DEFAULT_WHEN_EXHAUSTED_ACTION,
DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
- DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+ DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
}
@@ -483,7 +483,7 @@ public class GenericKeyedObjectPool<K, V
* if not <code>null</code>
* @param maxActive the maximum number of objects that can be borrowed
from me at one time
* (see {@link #setMaxActive})
- * @param whenExhaustedAction the action to take when the pool is
exhausted
+ * @param whenExhaustedAction the action to take when the pool is exhausted
* (see {@link #setWhenExhaustedAction})
* @param maxWait the maximum amount of time to wait for an idle object
when the pool is exhausted and
* <code>whenExhaustedAction</code> is {@link #WHEN_EXHAUSTED_BLOCK}
(otherwise ignored) (see {@link #setMaxWait})
@@ -935,7 +935,7 @@ public class GenericKeyedObjectPool<K, V
* Sets the max number of objects to examine during each run of the
* idle object evictor thread (if any).
* <p>
- * When a negative value is supplied,
+ * When a negative value is supplied,
* <code>ceil({@link #getNumIdle()})/abs({@link
#getNumTestsPerEvictionRun})</code>
* tests will be run. I.e., when the value is <code>-n</code>, roughly
one <code>n</code>th of the
* idle objects will be tested per run. When the value is positive, the
number of tests
@@ -1059,31 +1059,31 @@ public class GenericKeyedObjectPool<K, V
/**
* <p>Borrows an object from the keyed pool associated with the given
key.</p>
- *
+ *
* <p>If there is an idle instance available in the pool associated with
the given key, then
* either the most-recently returned (if {@link #getLifo() lifo} == true)
or "oldest" (lifo == false)
* instance sitting idle in the pool will be activated and returned. If
activation fails, or
* {@link #getTestOnBorrow() testOnBorrow} is set to true and validation
fails, the instance is destroyed and the
* next available instance is examined. This continues until either a
valid instance is returned or there
* are no more idle instances available.</p>
- *
+ *
* <p>If there are no idle instances available in the pool associated with
the given key, behavior
* depends on the {@link #getMaxActive() maxActive}, {@link #getMaxTotal()
maxTotal}, and (if applicable)
* {@link #getWhenExhaustedAction() whenExhaustedAction} and {@link
#getMaxWait() maxWait} properties. If the
* number of instances checked out from the pool under the given key is
less than <code>maxActive</code> and
* the total number of instances in circulation (under all keys) is less
than <code>maxTotal</code>, a new instance
* is created, activated and (if applicable) validated and returned to the
caller.</p>
- *
+ *
* <p>If the associated keyed pool is exhausted (no available idle
instances and no capacity to create new ones),
* this method will either block ({@link #WHEN_EXHAUSTED_BLOCK}), throw a
<code>NoSuchElementException</code>
* ({@link #WHEN_EXHAUSTED_FAIL}), or grow ({@link #WHEN_EXHAUSTED_GROW} -
ignoring maxActive, maxTotal properties).
* The length of time that this method will block when
<code>whenExhaustedAction == WHEN_EXHAUSTED_BLOCK</code>
* is determined by the {@link #getMaxWait() maxWait} property.</p>
- *
+ *
* <p>When the pool is exhausted, multiple calling threads may be
simultaneously blocked waiting for instances
* to become available. As of pool 1.5, a "fairness" algorithm has been
implemented to ensure that threads receive
* available instances in request arrival order.</p>
- *
+ *
* @param key pool key
* @return object instance from the keyed pool
* @throws NoSuchElementException if a keyed object instance cannot be
returned.
@@ -1283,9 +1283,9 @@ public class GenericKeyedObjectPool<K, V
synchronized (this) {
if (isClosed()) return;
-
+
Iterator<Latch<K, V>> allocationQueueIter =
_allocationQueue.iterator();
-
+
while (allocationQueueIter.hasNext()) {
// First use any objects in the pool to clear the queue
Latch<K, V> latch = allocationQueueIter.next();
@@ -1339,7 +1339,7 @@ public class GenericKeyedObjectPool<K, V
}
}
}
-
+
if (clearOldest) {
/* Clear oldest calls factory methods so it must be called from
* outside the sync block.
@@ -1352,13 +1352,13 @@ public class GenericKeyedObjectPool<K, V
clearOldest();
}
}
-
+
/**
* Clears any objects sitting idle in the pool by removing them from the
* idle instance pool and then invoking the configured
PoolableObjectFactory's
* {@link KeyedPoolableObjectFactory#destroyObject(Object, Object)} method
on
* each idle instance.
- *
+ *
* <p> Implementation notes:
* <ul><li>This method does not destroy or effect in any way instances
that are
* checked out when it is invoked.</li>
@@ -1394,7 +1394,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Clears oldest 15% of objects in pool. The method sorts the
* objects into a TreeMap and then iterates the first 15% for removal.
- *
+ *
* @since Pool 1.3
*/
public void clearOldest() {
@@ -1480,7 +1480,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Assuming Map<Object,Collection<ObjectTimestampPair>>, destroy all
* ObjectTimestampPair.value using the supplied factory.
- *
+ *
* @param m Map containing keyed pools to clear
* @param factory KeyedPoolableObjectFactory used to destroy the objects
*/
@@ -1565,18 +1565,18 @@ public class GenericKeyedObjectPool<K, V
/**
* <p>Returns an object to a keyed pool.</p>
- *
+ *
* <p>For the pool to function correctly, the object instance
<strong>must</strong> have been borrowed
* from the pool (under the same key) and not yet returned. Repeated
<code>returnObject</code> calls on
* the same object/key pair (with no <code>borrowObject</code> calls in
between) will result in multiple
* references to the object in the idle instance pool.</p>
- *
+ *
* <p>If {@link #getMaxIdle() maxIdle} is set to a positive value and the
number of idle instances under the given
* key has reached this value, the returning instance is destroyed.</p>
- *
+ *
* <p>If {@link #getTestOnReturn() testOnReturn} == true, the returning
instance is validated before being returned
* to the idle instance pool under the given key. In this case, if
validation fails, the instance is destroyed.</p>
- *
+ *
* @param key pool key
* @param obj instance to return to the keyed pool
* @throws Exception
@@ -1614,13 +1614,13 @@ public class GenericKeyedObjectPool<K, V
/**
* <p>Adds an object to the keyed pool.</p>
- *
+ *
* <p>Validates the object if testOnReturn == true and passivates it
before returning it to the pool.
* if validation or passivation fails, or maxIdle is set and there is no
room in the pool, the instance
* is destroyed.</p>
- *
+ *
* <p>Calls {@link #allocate()} on successful completion</p>
- *
+ *
* @param key pool key
* @param obj instance to add to the keyed pool
* @param decrementNumActive whether or not to decrement the active count
associated with the keyed pool
@@ -1704,9 +1704,9 @@ public class GenericKeyedObjectPool<K, V
/**
* {@inheritDoc}
- * <p>Activation of this method decrements the active count associated
with the given keyed pool
+ * <p>Activation of this method decrements the active count associated
with the given keyed pool
* and attempts to destroy <code>obj.</code></p>
- *
+ *
* @param key pool key
* @param obj instance to invalidate
* @throws Exception if an exception occurs destroying the object
@@ -1795,9 +1795,9 @@ public class GenericKeyedObjectPool<K, V
* will fail with IllegalStateException, but {@link #returnObject(Object,
Object)} and
* {@link #invalidateObject(Object, Object)} will continue to work, with
returned objects
* destroyed on return.</p>
- *
- * <p>Destroys idle instances in the pool by invoking {@link
#clear()}.</p>
- *
+ *
+ * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p>
+ *
* @throws Exception
*/
@Override
@@ -1814,10 +1814,10 @@ public class GenericKeyedObjectPool<K, V
_evictionKeyCursor = null;
}
startEvictor(-1L);
-
+
while(_allocationQueue.size() > 0) {
Latch<K, V> l = _allocationQueue.removeFirst();
-
+
synchronized (l) {
// notify the waiting thread
l.notify();
@@ -1828,11 +1828,11 @@ public class GenericKeyedObjectPool<K, V
/**
* <p>Sets the keyed poolable object factory associated with this pool.</p>
- *
+ *
* <p>If this method is called when objects are checked out of any of the
keyed pools,
* an IllegalStateException is thrown. Calling this method also has the
side effect of
* destroying any idle instances in existing keyed pools, using the
original factory.</p>
- *
+ *
* @param factory KeyedPoolableObjectFactory to use when creating keyed
object pool instances
* @throws IllegalStateException if there are active (checked out)
instances associated with this keyed object pool
* @deprecated to be removed in version 2.0
@@ -2157,7 +2157,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Returns pool info including {@link #getNumActive()}, {@link
#getNumIdle()}
* and currently defined keys.
- *
+ *
* @return string containing debug information
*/
synchronized String debugInfo() {
@@ -2172,11 +2172,11 @@ public class GenericKeyedObjectPool<K, V
return buf.toString();
}
- /**
+ /**
* Returns the number of tests to be performed in an Evictor run,
* based on the current values of <code>_numTestsPerEvictionRun</code>
* and <code>_totalIdle</code>.
- *
+ *
* @see #setNumTestsPerEvictionRun
* @return the number of tests for the Evictor to run
*/
@@ -2192,7 +2192,7 @@ public class GenericKeyedObjectPool<K, V
* This returns the number of objects to create during the pool
* sustain cycle. This will ensure that the minimum number of idle
* instances is maintained without going past the maxActive value.
- *
+ *
* @param pool the ObjectPool to calculate the deficit for
* @param incrementInternal - Should the count of objects currently under
* some form of internal processing be
@@ -2231,10 +2231,10 @@ public class GenericKeyedObjectPool<K, V
private class ObjectQueue {
/** Number of instances checked out to clients from this queue */
private int activeCount = 0;
-
+
/** Idle instance queue */
private final CursorableLinkedList<ObjectTimestampPair<V>> queue = new
CursorableLinkedList<ObjectTimestampPair<V>>();
-
+
/** Number of instances in process of being created */
private int internalProcessingCount = 0;
@@ -2282,13 +2282,13 @@ public class GenericKeyedObjectPool<K, V
*/
static class ObjectTimestampPair<T> implements Comparable<T> {
//CHECKSTYLE: stop VisibilityModifier
- /**
- * Object instance
+ /**
+ * Object instance
* @deprecated this field will be made private and final in version 2.0
*/
@Deprecated
T value;
-
+
/**
* timestamp
* @deprecated this field will be made private and final in version 2.0
@@ -2317,7 +2317,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Returns a string representation.
- *
+ *
* @return String representing this ObjectTimestampPair
*/
@Override
@@ -2328,7 +2328,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Compares this to another object by casting the argument to an
* ObjectTimestampPair.
- *
+ *
* @param obj object to cmpare
* @return result of comparison
*/
@@ -2340,7 +2340,7 @@ public class GenericKeyedObjectPool<K, V
/**
* Compares this to another ObjectTimestampPair, using the timestamp
as basis for comparison.
* Implementation is consistent with equals.
- *
+ *
* @param other object to compare
* @return result of comparison
*/
@@ -2468,20 +2468,20 @@ public class GenericKeyedObjectPool<K, V
* Latch used to control allocation order of objects to threads to ensure
* fairness. That is, for each key, objects are allocated to threads in
the order
* that threads request objects.
- *
+ *
* @since 1.5
*/
private final class Latch<LK, LV> {
-
+
/** key of associated pool */
private final LK _key;
-
+
/** keyed pool associated with this latch */
private ObjectQueue _pool;
-
+
/** holds an ObjectTimestampPair when this latch has been allocated an
instance */
private ObjectTimestampPair<LV> _pair;
-
+
/** indicates that this latch can create an instance */
private boolean _mayCreate = false;
@@ -2508,7 +2508,7 @@ public class GenericKeyedObjectPool<K, V
private synchronized ObjectQueue getPool() {
return _pool;
}
-
+
/**
* Sets the pool associated with this latch
* @param pool the pool
@@ -2519,13 +2519,13 @@ public class GenericKeyedObjectPool<K, V
/**
* Gets the ObjectTimestampPair allocated to this latch.
- * Returns null if this latch does not have an instance allocated to
it.
+ * Returns null if this latch does not have an instance allocated to
it.
* @return the associated ObjectTimestampPair
*/
private synchronized ObjectTimestampPair<LV> getPair() {
return _pair;
}
-
+
/**
* Allocate an ObjectTimestampPair to this latch.
* @param pair ObjectTimestampPair on this latch
@@ -2541,10 +2541,10 @@ public class GenericKeyedObjectPool<K, V
private synchronized boolean mayCreate() {
return _mayCreate;
}
-
+
/**
* Sets the mayCreate property
- *
+ *
* @param mayCreate true means this latch can create an instance
*/
private synchronized void setMayCreate(boolean mayCreate) {
@@ -2732,7 +2732,7 @@ public class GenericKeyedObjectPool<K, V
/** Eviction cursor (over instances within-key) */
private CursorableLinkedList<ObjectTimestampPair<V>>.Cursor
_evictionCursor = null;
-
+
/** Eviction cursor (over keys) */
private CursorableLinkedList<K>.Cursor _evictionKeyCursor = null;
Modified:
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=1243731&r1=1243730&r2=1243731&view=diff
==============================================================================
---
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
(original)
+++
commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Mon Feb 13 23:11:00 2012
@@ -181,7 +181,7 @@ import org.apache.commons.pool.impl.Gene
* block. See POOL-125 and DBCP-44 for more information.
*
* @param <T> the type of objects held in this pool
- *
+ *
* @see GenericKeyedObjectPool
* @author Rodney Waldhoff
* @author Dirk Verbeeck
@@ -363,8 +363,8 @@ public class GenericObjectPool<T> extend
*/
public GenericObjectPool(PoolableObjectFactory<T> factory,
GenericObjectPool.Config config) {
this(factory, config.maxActive, config.whenExhaustedAction,
config.maxWait, config.maxIdle, config.minIdle,
- config.testOnBorrow, config.testOnReturn,
config.timeBetweenEvictionRunsMillis,
- config.numTestsPerEvictionRun,
config.minEvictableIdleTimeMillis, config.testWhileIdle,
+ config.testOnBorrow, config.testOnReturn,
config.timeBetweenEvictionRunsMillis,
+ config.numTestsPerEvictionRun,
config.minEvictableIdleTimeMillis, config.testWhileIdle,
config.softMinEvictableIdleTimeMillis, config.lifo);
}
@@ -417,7 +417,7 @@ public class GenericObjectPool<T> extend
* @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use
to create, validate and destroy objects
* @param maxActive the maximum number of objects that can be borrowed at
one time (see {@link #setMaxActive})
* @param whenExhaustedAction the action to take when the pool is
exhausted (see {@link #getWhenExhaustedAction})
- * @param maxWait the maximum amount of time to wait for an idle object
when the pool is exhausted and
+ * @param maxWait the maximum amount of time to wait for an idle object
when the pool is exhausted and
* <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise
ignored) (see {@link #getMaxWait})
* @param maxIdle the maximum number of idle objects in my pool (see
{@link #getMaxIdle})
*/
@@ -452,7 +452,7 @@ public class GenericObjectPool<T> extend
* @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use
to create, validate and destroy objects
* @param maxActive the maximum number of objects that can be borrowed at
one time (see {@link #setMaxActive})
* @param whenExhaustedAction the action to take when the pool is
exhausted (see {@link #setWhenExhaustedAction})
- * @param maxWait the maximum amount of time to wait for an idle object
when the pool is exhausted and
+ * @param maxWait the maximum amount of time to wait for an idle object
when the pool is exhausted and
* <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise
ignored) (see {@link #setMaxWait})
* @param maxIdle the maximum number of idle objects in my pool (see
{@link #setMaxIdle})
* @param testOnBorrow whether or not to validate objects before they are
returned by the {@link #borrowObject}
@@ -1029,28 +1029,28 @@ public class GenericObjectPool<T> extend
/**
* <p>Borrows an object from the pool.</p>
- *
+ *
* <p>If there is an idle instance available in the pool, then either the
most-recently returned
* (if {@link #getLifo() lifo} == true) or "oldest" (lifo == false)
instance sitting idle in the pool
* will be activated and returned. If activation fails, or {@link
#getTestOnBorrow() testOnBorrow} is set
* to true and validation fails, the instance is destroyed and the next
available instance is examined.
* This continues until either a valid instance is returned or there are
no more idle instances available.</p>
- *
+ *
* <p>If there are no idle instances available in the pool, behavior
depends on the {@link #getMaxActive() maxActive}
* and (if applicable) {@link #getWhenExhaustedAction()
whenExhaustedAction} and {@link #getMaxWait() maxWait}
* properties. If the number of instances checked out from the pool is
less than <code>maxActive,</code> a new
* instance is created, activated and (if applicable) validated and
returned to the caller.</p>
- *
+ *
* <p>If the pool is exhausted (no available idle instances and no
capacity to create new ones),
* this method will either block ({@link #WHEN_EXHAUSTED_BLOCK}), throw a
<code>NoSuchElementException</code>
* ({@link #WHEN_EXHAUSTED_FAIL}), or grow ({@link #WHEN_EXHAUSTED_GROW} -
ignoring maxActive).
* The length of time that this method will block when
<code>whenExhaustedAction == WHEN_EXHAUSTED_BLOCK</code>
* is determined by the {@link #getMaxWait() maxWait} property.</p>
- *
+ *
* <p>When the pool is exhausted, multiple calling threads may be
simultaneously blocked waiting for instances
* to become available. As of pool 1.5, a "fairness" algorithm has been
implemented to ensure that threads receive
* available instances in request arrival order.</p>
- *
+ *
* @return object instance
* @throws NoSuchElementException if an instance cannot be returned
*/
@@ -1243,7 +1243,7 @@ public class GenericObjectPool<T> extend
* Allocate available instances to latches in the allocation queue. Then
* set _mayCreate to true for as many additional latches remaining in queue
* as _maxActive allows. While it is safe for GOP, for consistency with
GKOP
- * this method should not be called from inside a sync block.
+ * this method should not be called from inside a sync block.
*/
private synchronized void allocate() {
if (isClosed()) return;
@@ -1280,7 +1280,7 @@ public class GenericObjectPool<T> extend
/**
* {@inheritDoc}
* <p>Activation of this method decrements the active count and attempts
to destroy the instance.</p>
- *
+ *
* @throws Exception if the configured {@link PoolableObjectFactory}
throws an exception destroying obj
*/
@Override
@@ -1299,10 +1299,10 @@ public class GenericObjectPool<T> extend
/**
* Clears any objects sitting idle in the pool by removing them from the
- * idle instance pool and then invoking the configured
+ * idle instance pool and then invoking the configured
* {@link PoolableObjectFactory#destroyObject(Object)} method on each idle
- * instance.
- *
+ * instance.
+ *
* <p> Implementation notes:
* <ul><li>This method does not destroy or effect in any way instances
that are
* checked out of the pool when it is invoked.</li>
@@ -1325,11 +1325,11 @@ public class GenericObjectPool<T> extend
}
/**
- * Private method to destroy all the objects in a collection using the
+ * Private method to destroy all the objects in a collection using the
* supplied object factory. Assumes that objects in the collection are
* instances of ObjectTimestampPair and that the object instances that
* they wrap were created by the factory.
- *
+ *
* @param c Collection of objects to destroy
* @param factory PoolableConnectionFactory used to destroy the objects
*/
@@ -1370,13 +1370,13 @@ public class GenericObjectPool<T> extend
/**
* <p>Returns an object instance to the pool.</p>
- *
+ *
* <p>If {@link #getMaxIdle() maxIdle} is set to a positive value and the
number of idle instances
* has reached this value, the returning instance is destroyed.</p>
- *
+ *
* <p>If {@link #getTestOnReturn() testOnReturn} == true, the returning
instance is validated before being returned
* to the idle instance pool. In this case, if validation fails, the
instance is destroyed.</p>
- *
+ *
* <p><strong>Note: </strong> There is no guard to prevent an object
* being returned to the pool multiple times. Clients are expected to
* discard references to returned objects and ensure that an object is not
@@ -1384,7 +1384,7 @@ public class GenericObjectPool<T> extend
* borrowed again between returns). Violating this contract will result in
* the same object appearing multiple times in the pool and pool counters
* (numActive, numIdle) returning incorrect values.</p>
- *
+ *
* @param obj instance to return to the pool
*/
@Override
@@ -1411,13 +1411,13 @@ public class GenericObjectPool<T> extend
/**
* <p>Adds an object to the pool.</p>
- *
+ *
* <p>Validates the object if testOnReturn == true and passivates it
before returning it to the pool.
* if validation or passivation fails, or maxIdle is set and there is no
room in the pool, the instance
* is destroyed.</p>
- *
+ *
* <p>Calls {@link #allocate()} on successful completion</p>
- *
+ *
* @param obj instance to add to the pool
* @param decrementNumActive whether or not to decrement the active count
* @throws Exception
@@ -1483,9 +1483,9 @@ public class GenericObjectPool<T> extend
* will fail with IllegalStateException, but {@link #returnObject(Object)}
and
* {@link #invalidateObject(Object)} will continue to work, with returned
objects
* destroyed on return.</p>
- *
- * <p>Destroys idle instances in the pool by invoking {@link
#clear()}.</p>
- *
+ *
+ * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p>
+ *
* @throws Exception
*/
@Override
@@ -1497,7 +1497,7 @@ public class GenericObjectPool<T> extend
while(_allocationQueue.size() > 0) {
Latch<T> l = _allocationQueue.removeFirst();
-
+
synchronized (l) {
// notify the waiting thread
l.notify();
@@ -1534,7 +1534,7 @@ public class GenericObjectPool<T> extend
}
_factory = factory;
}
- destroy(toDestroy, oldFactory);
+ destroy(toDestroy, oldFactory);
}
/**
@@ -1725,7 +1725,7 @@ public class GenericObjectPool<T> extend
/**
* Returns pool info including {@link #getNumActive()}, {@link
#getNumIdle()}
* and a list of objects idle in the pool with their idle times.
- *
+ *
* @return string containing debug information
*/
synchronized String debugInfo() {
@@ -1742,11 +1742,11 @@ public class GenericObjectPool<T> extend
return buf.toString();
}
- /**
+ /**
* 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
*/
@@ -1858,10 +1858,10 @@ public class GenericObjectPool<T> extend
* threads request objects.
*/
private static final class Latch<T> {
-
+
/** object timestamp pair allocated to this latch */
private ObjectTimestampPair<T> _pair;
-
+
/** Whether or not this latch may create an object instance */
private boolean _mayCreate = false;
@@ -1872,7 +1872,7 @@ public class GenericObjectPool<T> extend
private synchronized ObjectTimestampPair<T> getPair() {
return _pair;
}
-
+
/**
* Sets ObjectTimestampPair on this latch
* @param pair ObjectTimestampPair allocated to this latch
@@ -1882,13 +1882,13 @@ public class GenericObjectPool<T> extend
}
/**
- * Whether or not this latch may create an object instance
+ * Whether or not this latch may create an object instance
* @return true if this latch has an instance creation permit
*/
private synchronized boolean mayCreate() {
return _mayCreate;
}
-
+
/**
* Sets the mayCreate property
* @param mayCreate new value for mayCreate