You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/10/13 02:45:08 UTC
svn commit: r1021964 -
/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Author: sebb
Date: Wed Oct 13 00:45:07 2010
New Revision: 1021964
URL: http://svn.apache.org/viewvc?rev=1021964&view=rev
Log:
Make private immutable fields final
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java?rev=1021964&r1=1021963&r2=1021964&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java Wed Oct 13 00:45:07 2010
@@ -490,7 +490,7 @@ public class StackKeyedObjectPool<K,V> e
* @return the initial capacity of each pool.
* @since 1.5.5
*/
- public synchronized int getInitSleepingCapacity() {
+ public int getInitSleepingCapacity() {
return _initSleepingCapacity;
}
@@ -530,7 +530,7 @@ public class StackKeyedObjectPool<K,V> e
/**
* My named-set of pools.
*/
- private HashMap<K,Stack<V>> _pools = null;
+ private final HashMap<K,Stack<V>> _pools;
/**
* My {@link KeyedPoolableObjectFactory}.
@@ -540,26 +540,26 @@ public class StackKeyedObjectPool<K,V> e
/**
* The cap on the number of "sleeping" instances in <code>each</code> pool.
*/
- private int _maxSleeping = DEFAULT_MAX_SLEEPING;
+ private int _maxSleeping = DEFAULT_MAX_SLEEPING; // @GuardedBy("this")
/**
* The initial capacity of each pool.
*/
- private int _initSleepingCapacity = DEFAULT_INIT_SLEEPING_CAPACITY;
+ private final int _initSleepingCapacity;
/**
* Total number of object borrowed and not yet returned for all pools.
*/
- private int _totActive = 0;
+ private int _totActive = 0; // @GuardedBy("this")
/**
* Total number of objects "sleeping" for all pools.
*/
- private int _totIdle = 0;
+ private int _totIdle = 0; // @GuardedBy("this")
/**
* Number of active objects borrowed and not yet returned by pool.
*/
- private HashMap<K,Integer> _activeCount = null;
+ private final HashMap<K,Integer> _activeCount; // @GuardedBy("this")
}