Author: sebb
Date: Thu Dec 15 01:18:23 2011
New Revision: 1214587
URL: http://svn.apache.org/viewvc?rev=1214587&view=rev
Log:
Make private write once fields final (ensure safe publication)
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1214587&r1=1214586&r2=1214587&view=diff
==============================================================================
---
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
(original)
+++
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Thu Dec 15 01:18:23 2011
@@ -1896,10 +1896,10 @@ public class GenericKeyedObjectPool<K,T>
* Number of instances created - number destroyed.
* Invariant: createCount <= maxTotalPerKey
*/
- private AtomicInteger createCount = new AtomicInteger(0);
+ private final AtomicInteger createCount = new AtomicInteger(0);
/** All instances under management - checked out our idle in the pool.
*/
- private Map<S, PooledObject<S>> allObjects =
+ private final Map<S, PooledObject<S>> allObjects =
new ConcurrentHashMap<S, PooledObject<S>>();
/**
@@ -1907,7 +1907,7 @@ public class GenericKeyedObjectPool<K,T>
* register(K) increments this counter and deRegister(K) decrements it.
* Invariant: empty keyed pool will not be dropped unless
numInterested is 0.
*/
- private AtomicLong numInterested = new AtomicLong(0);
+ private final AtomicLong numInterested = new AtomicLong(0);
/**
* Returns the idle instance pool.