commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject [15/50] [abbrv] commons-pool git commit: Add final modifier to local variables.
Date Sun, 12 Mar 2017 19:47:45 GMT
http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java b/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java
index dc14e07..06a3984 100644
--- a/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java
+++ b/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java
@@ -58,11 +58,11 @@ class PoolImplUtils {
         // Look to see if this class implements the generic interface
 
         // Get all the interfaces
-        Type[] interfaces = clazz.getGenericInterfaces();
-        for (Type iface : interfaces) {
+        final Type[] interfaces = clazz.getGenericInterfaces();
+        for (final Type iface : interfaces) {
             // Only need to check interfaces that use generics
             if (iface instanceof ParameterizedType) {
-                ParameterizedType pi = (ParameterizedType) iface;
+                final ParameterizedType pi = (ParameterizedType) iface;
                 // Look for the generic interface
                 if (pi.getRawType() instanceof Class) {
                     if (type.isAssignableFrom((Class<?>) pi.getRawType())) {
@@ -75,10 +75,11 @@ class PoolImplUtils {
 
         // Interface not found on this class. Look at the superclass.
         @SuppressWarnings("unchecked")
+        final
         Class<? extends T> superClazz =
                 (Class<? extends T>) clazz.getSuperclass();
 
-        Object result = getGenericType(type, superClazz);
+        final Object result = getGenericType(type, superClazz);
         if (result instanceof Class<?>) {
             // Superclass implements interface and defines explicit type for
             // generic
@@ -87,7 +88,7 @@ class PoolImplUtils {
             // Superclass implements interface and defines unknown type for
             // generic
             // Map that unknown type to the generic types defined in this class
-            ParameterizedType superClassType =
+            final ParameterizedType superClassType =
                     (ParameterizedType) clazz.getGenericSuperclass();
             return getTypeParameter(clazz,
                     superClassType.getActualTypeArguments()[
@@ -114,7 +115,7 @@ class PoolImplUtils {
         if (argType instanceof Class<?>) {
             return argType;
         }
-        TypeVariable<?>[] tvs = clazz.getTypeParameters();
+        final TypeVariable<?>[] tvs = clazz.getTypeParameters();
         for (int i = 0; i < tvs.length; i++) {
             if (tvs[i].equals(argType)) {
                 return Integer.valueOf(i);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java b/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java
index 104bc56..15d385f 100644
--- a/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java
+++ b/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java
@@ -63,7 +63,7 @@ public class PooledSoftReference<T> extends DefaultPooledObject<T> {
      */
     @Override
     public String toString() {
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
         result.append("Referenced Object: ");
         result.append(getObject().toString());
         result.append(", State: ");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
index 3c1c54a..fd4f38a 100644
--- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
@@ -146,11 +146,11 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
                     if (!factory.validateObject(ref)) {
                         throw new Exception("ValidateObject failed");
                     }
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     PoolUtils.checkRethrow(t);
                     try {
                         destroy(ref);
-                    } catch (Throwable t2) {
+                    } catch (final Throwable t2) {
                         PoolUtils.checkRethrow(t2);
                         // Swallowed
                     } finally {
@@ -202,13 +202,13 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
             } else {
                 try {
                     factory.passivateObject(ref);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     success = false;
                 }
             }
         }
 
-        boolean shouldDestroy = !success;
+        final boolean shouldDestroy = !success;
         numActive--;
         if (success) {
 
@@ -221,7 +221,7 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
         if (shouldDestroy && factory != null) {
             try {
                 destroy(ref);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // ignored
             }
         }
@@ -273,10 +273,10 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
             throw new IllegalStateException(
                     "Cannot add objects without a factory.");
         }
-        T obj = factory.makeObject().getObject();
+        final T obj = factory.makeObject().getObject();
         createCount++;
         // Create and register with the queue
-        PooledSoftReference<T> ref = new PooledSoftReference<T>(
+        final PooledSoftReference<T> ref = new PooledSoftReference<T>(
                 new SoftReference<T>(obj, refQueue));
         allReferences.add(ref);
 
@@ -287,7 +287,7 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
             factory.passivateObject(ref);
         }
 
-        boolean shouldDestroy = !success;
+        final boolean shouldDestroy = !success;
         if (success) {
             idleReferences.add(ref);
             notifyAll(); // numActive has changed
@@ -296,7 +296,7 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
         if (shouldDestroy) {
             try {
                 destroy(ref);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // ignored
             }
         }
@@ -330,14 +330,14 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
     @Override
     public synchronized void clear() {
         if (null != factory) {
-            Iterator<PooledSoftReference<T>> iter = idleReferences.iterator();
+            final Iterator<PooledSoftReference<T>> iter = idleReferences.iterator();
             while (iter.hasNext()) {
                 try {
                     final PooledSoftReference<T> ref = iter.next();
                     if (null != ref.getObject()) {
                         factory.destroyObject(ref);
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     // ignore error, keep destroying the rest
                 }
             }
@@ -388,7 +388,7 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
      * @return PooledSoftReference wrapping a soft reference to obj
      */
     private PooledSoftReference<T> findReference(T obj) {
-        Iterator<PooledSoftReference<T>> iterator = allReferences.iterator();
+        final Iterator<PooledSoftReference<T>> iterator = allReferences.iterator();
         while (iterator.hasNext()) {
             final PooledSoftReference<T> reference = iterator.next();
             if (reference.getObject() != null && reference.getObject().equals(obj)) {

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java b/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java
index 20e3c01..4da1b44 100644
--- a/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java
+++ b/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java
@@ -66,7 +66,7 @@ class BaseProxyHandler<T> {
      * @return the object that this proxy was wrapping
      */
     T disableProxy() {
-        T result = pooledObject;
+        final T result = pooledObject;
         pooledObject = null;
         return result;
     }
@@ -96,7 +96,7 @@ class BaseProxyHandler<T> {
      */
     Object doInvoke(Method method, Object[] args) throws Throwable {
         validateProxiedObject();
-        T object = getPooledObject();
+        final T object = getPooledObject();
         if (usageTracking != null) {
             usageTracking.use(object);
         }
@@ -109,7 +109,7 @@ class BaseProxyHandler<T> {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append(getClass().getName());
         builder.append(" [pooledObject=");
         builder.append(pooledObject);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java b/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java
index 53d1247..8781474 100644
--- a/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java
+++ b/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java
@@ -43,14 +43,15 @@ public class CglibProxySource<T> implements ProxySource<T> {
 
     @Override
     public T createProxy(T pooledObject, UsageTracking<T> usageTracking) {
-        Enhancer enhancer = new Enhancer();
+        final Enhancer enhancer = new Enhancer();
         enhancer.setSuperclass(superclass);
 
-        CglibProxyHandler<T> proxyInterceptor =
+        final CglibProxyHandler<T> proxyInterceptor =
                 new CglibProxyHandler<T>(pooledObject, usageTracking);
         enhancer.setCallback(proxyInterceptor);
 
         @SuppressWarnings("unchecked")
+        final
         T proxy = (T) enhancer.create();
 
         return proxy;
@@ -60,9 +61,10 @@ public class CglibProxySource<T> implements ProxySource<T> {
     @Override
     public T resolveProxy(T proxy) {
         @SuppressWarnings("unchecked")
+        final
         CglibProxyHandler<T> cglibProxyHandler =
                 (CglibProxyHandler<T>) ((Factory) proxy).getCallback(0);
-        T pooledObject = cglibProxyHandler.disableProxy();
+        final T pooledObject = cglibProxyHandler.disableProxy();
         return pooledObject;
     }
 
@@ -71,7 +73,7 @@ public class CglibProxySource<T> implements ProxySource<T> {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("CglibProxySource [superclass=");
         builder.append(superclass);
         builder.append("]");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java b/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java
index d448458..0c74f82 100644
--- a/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java
+++ b/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java
@@ -51,6 +51,7 @@ public class JdkProxySource<T> implements ProxySource<T> {
     @Override
     public T createProxy(T pooledObject, UsageTracking<T> usageTracking) {
         @SuppressWarnings("unchecked")
+        final
         T proxy = (T) Proxy.newProxyInstance(classLoader, interfaces,
                 new JdkProxyHandler<T>(pooledObject, usageTracking));
         return proxy;
@@ -60,9 +61,10 @@ public class JdkProxySource<T> implements ProxySource<T> {
     @Override
     public T resolveProxy(T proxy) {
         @SuppressWarnings("unchecked")
+        final
         JdkProxyHandler<T> jdkProxyHandler =
                 (JdkProxyHandler<T>) Proxy.getInvocationHandler(proxy);
-        T pooledObject = jdkProxyHandler.disableProxy();
+        final T pooledObject = jdkProxyHandler.disableProxy();
         return pooledObject;
     }
 
@@ -72,7 +74,7 @@ public class JdkProxySource<T> implements ProxySource<T> {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("JdkProxySource [classLoader=");
         builder.append(classLoader);
         builder.append(", interfaces=");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java
index b2b4881..26536b0 100644
--- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java
@@ -59,20 +59,20 @@ public class ProxiedKeyedObjectPool<K,V> implements KeyedObjectPool<K,V> {
         if (pool instanceof UsageTracking) {
             usageTracking = (UsageTracking<V>) pool;
         }
-        V pooledObject = pool.borrowObject(key);
-        V proxy = proxySource.createProxy(pooledObject, usageTracking);
+        final V pooledObject = pool.borrowObject(key);
+        final V proxy = proxySource.createProxy(pooledObject, usageTracking);
         return proxy;
     }
 
     @Override
     public void returnObject(K key, V proxy) throws Exception {
-        V pooledObject = proxySource.resolveProxy(proxy);
+        final V pooledObject = proxySource.resolveProxy(proxy);
         pool.returnObject(key, pooledObject);
     }
 
     @Override
     public void invalidateObject(K key, V proxy) throws Exception {
-        V pooledObject = proxySource.resolveProxy(proxy);
+        final V pooledObject = proxySource.resolveProxy(proxy);
         pool.invalidateObject(key, pooledObject);
     }
 
@@ -123,7 +123,7 @@ public class ProxiedKeyedObjectPool<K,V> implements KeyedObjectPool<K,V> {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("ProxiedKeyedObjectPool [pool=");
         builder.append(pool);
         builder.append(", proxySource=");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java b/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java
index 891213d..59c5402 100644
--- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java
@@ -59,22 +59,22 @@ public class ProxiedObjectPool<T> implements ObjectPool<T> {
         if (pool instanceof UsageTracking) {
             usageTracking = (UsageTracking<T>) pool;
         }
-        T pooledObject = pool.borrowObject();
-        T proxy = proxySource.createProxy(pooledObject, usageTracking);
+        final T pooledObject = pool.borrowObject();
+        final T proxy = proxySource.createProxy(pooledObject, usageTracking);
         return proxy;
     }
 
 
     @Override
     public void returnObject(T proxy) throws Exception {
-        T pooledObject = proxySource.resolveProxy(proxy);
+        final T pooledObject = proxySource.resolveProxy(proxy);
         pool.returnObject(pooledObject);
     }
 
 
     @Override
     public void invalidateObject(T proxy) throws Exception {
-        T pooledObject = proxySource.resolveProxy(proxy);
+        final T pooledObject = proxySource.resolveProxy(proxy);
         pool.invalidateObject(pooledObject);
     }
 
@@ -115,7 +115,7 @@ public class ProxiedObjectPool<T> implements ObjectPool<T> {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("ProxiedObjectPool [pool=");
         builder.append(pool);
         builder.append(", proxySource=");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java b/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
index 991ff6b..364debb 100644
--- a/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
+++ b/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
@@ -114,7 +114,7 @@ public class MethodCallPoolableObjectFactory implements PooledObjectFactory<Obje
     public PooledObject<Object> makeObject() throws Exception {
         final MethodCall call = new MethodCall("makeObject");
         methodCalls.add(call);
-        int originalCount = this.count++;
+        final int originalCount = this.count++;
         if (makeObjectFail) {
             throw new PrivateException("makeObject");
         }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java b/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java
index 35052c8..3125993 100644
--- a/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java
+++ b/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java
@@ -28,7 +28,7 @@ public class TestBaseKeyedPoolableObjectFactory {
 
     @Test
     public void testDefaultMethods() throws Exception {
-        KeyedPooledObjectFactory<Object,Object> factory = new TestFactory();
+        final KeyedPooledObjectFactory<Object,Object> factory = new TestFactory();
 
         factory.activateObject("key",null); // a no-op
         factory.passivateObject("key",null); // a no-op

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java b/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java
index c82e577..fc81213 100644
--- a/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java
@@ -81,7 +81,7 @@ public class TestBaseObjectPool extends TestObjectPool {
         if (!getClass().equals(TestBaseObjectPool.class)) {
             return; // skip redundant tests
         }
-        ObjectPool<Object> pool = new TestObjectPool();
+        final ObjectPool<Object> pool = new TestObjectPool();
 
         assertTrue("Negative expected.", pool.getNumIdle() < 0);
         assertTrue("Negative expected.", pool.getNumActive() < 0);
@@ -89,21 +89,21 @@ public class TestBaseObjectPool extends TestObjectPool {
         try {
             pool.clear();
             fail("Expected UnsupportedOperationException");
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             // expected
         }
 
         try {
             pool.addObject();
             fail("Expected UnsupportedOperationException");
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             // expected
         }
     }
 
     @Test
     public void testClose() throws Exception {
-        ObjectPool<Object> pool = new TestObjectPool();
+        final ObjectPool<Object> pool = new TestObjectPool();
 
         pool.close();
         pool.close(); // should not error as of Pool 2.0.
@@ -113,7 +113,7 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseBorrow() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         assertEquals(getNthObject(0),_pool.borrowObject());
@@ -126,7 +126,7 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseAddObject() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         try {
@@ -135,14 +135,14 @@ public class TestBaseObjectPool extends TestObjectPool {
             _pool.addObject();
             assertEquals(1,_pool.getNumIdle());
             assertEquals(0,_pool.getNumActive());
-            String obj = _pool.borrowObject();
+            final String obj = _pool.borrowObject();
             assertEquals(getNthObject(0),obj);
             assertEquals(0,_pool.getNumIdle());
             assertEquals(1,_pool.getNumActive());
             _pool.returnObject(obj);
             assertEquals(1,_pool.getNumIdle());
             assertEquals(0,_pool.getNumActive());
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if one of those calls is unsupported
         } finally {
             _pool.close();
@@ -153,7 +153,7 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseBorrowReturn() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         String obj0 = _pool.borrowObject();
@@ -192,15 +192,15 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseNumActiveNumIdle() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        String obj0 = _pool.borrowObject();
+        final String obj0 = _pool.borrowObject();
         assertEquals(1,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        String obj1 = _pool.borrowObject();
+        final String obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.returnObject(obj1);
@@ -216,13 +216,13 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseClear() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        String obj0 = _pool.borrowObject();
-        String obj1 = _pool.borrowObject();
+        final String obj0 = _pool.borrowObject();
+        final String obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.returnObject(obj1);
@@ -232,7 +232,7 @@ public class TestBaseObjectPool extends TestObjectPool {
         _pool.clear();
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        Object obj2 = _pool.borrowObject();
+        final Object obj2 = _pool.borrowObject();
         assertEquals(getNthObject(2),obj2);
         _pool.close();
     }
@@ -241,13 +241,13 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseInvalidateObject() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        String obj0 = _pool.borrowObject();
-        String obj1 = _pool.borrowObject();
+        final String obj0 = _pool.borrowObject();
+        final String obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.invalidateObject(obj0);
@@ -263,17 +263,17 @@ public class TestBaseObjectPool extends TestObjectPool {
     public void testBaseClosePool() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
-        String obj = _pool.borrowObject();
+        final String obj = _pool.borrowObject();
         _pool.returnObject(obj);
 
         _pool.close();
         try {
             _pool.borrowObject();
             fail("Expected IllegalStateException");
-        } catch(IllegalStateException e) {
+        } catch(final IllegalStateException e) {
             // expected
         }
     }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java b/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java
index ad7bf8f..82eb630 100644
--- a/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java
+++ b/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java
@@ -28,7 +28,7 @@ public class TestBasePoolableObjectFactory {
 
     @Test
     public void testDefaultMethods() throws Exception {
-        PooledObjectFactory<Object> factory = new TestFactory();
+        final PooledObjectFactory<Object> factory = new TestFactory();
 
         factory.activateObject(null); // a no-op
         factory.passivateObject(null); // a no-op

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java
index e17b7d1..809ebb4 100644
--- a/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java
@@ -89,26 +89,26 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(new TestFactory());
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
 
-        Object o1 = pool.borrowObject(KEY);
-        Object o2 = pool.borrowObject(KEY);
+        final Object o1 = pool.borrowObject(KEY);
+        final Object o2 = pool.borrowObject(KEY);
 
         pool.close();
 
         try {
             pool.addObject(KEY);
             fail("A closed pool must throw an IllegalStateException when addObject is called.");
-        } catch (IllegalStateException ise) {
+        } catch (final IllegalStateException ise) {
             // expected
         }
 
         try {
             pool.borrowObject(KEY);
             fail("A closed pool must throw an IllegalStateException when borrowObject is called.");
-        } catch (IllegalStateException ise) {
+        } catch (final IllegalStateException ise) {
             // expected
         }
 
@@ -137,7 +137,7 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -156,7 +156,7 @@ public abstract class TestKeyedObjectPool {
         try {
             pool.addObject(KEY);
             fail("Expected addObject to propagate makeObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject", KEY));
@@ -170,7 +170,7 @@ public abstract class TestKeyedObjectPool {
         try {
             pool.addObject(KEY);
             fail("Expected addObject to propagate passivateObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject", KEY).returned(ONE));
@@ -185,7 +185,7 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -214,7 +214,7 @@ public abstract class TestKeyedObjectPool {
         try {
             obj = pool.borrowObject(KEY);
             fail("Expected borrowObject to propagate makeObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject", KEY));
@@ -231,7 +231,7 @@ public abstract class TestKeyedObjectPool {
         try {
             pool.borrowObject(KEY);
             fail("Expecting NoSuchElementException");
-        } catch (NoSuchElementException e) {
+        } catch (final NoSuchElementException e) {
             //Activate should fail
         }
         // After idle object fails validation, new on is created and activation
@@ -252,7 +252,7 @@ public abstract class TestKeyedObjectPool {
         try {
             pool.borrowObject(KEY);
             fail("Expecting NoSuchElementException");
-        } catch (NoSuchElementException ex) {
+        } catch (final NoSuchElementException ex) {
             // expected
         }
         // Activate, then validate for idle instance
@@ -273,7 +273,7 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -319,7 +319,7 @@ public abstract class TestKeyedObjectPool {
             if (!(pool instanceof GenericKeyedObjectPool)) { // ugh, 1.3-compat
                 fail("Expecting destroyObject exception to be propagated");
             }
-        } catch (PrivateException ex) {
+        } catch (final PrivateException ex) {
             // Expected
         }
         pool.close();
@@ -331,7 +331,7 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -355,7 +355,7 @@ public abstract class TestKeyedObjectPool {
         try {
             pool.invalidateObject(KEY, obj);
             fail("Expecting destroy exception to propagate");
-        } catch (PrivateException ex) {
+        } catch (final PrivateException ex) {
             // Expected
         }
         Thread.sleep(250); // could be defered
@@ -370,7 +370,7 @@ public abstract class TestKeyedObjectPool {
         final KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -393,7 +393,7 @@ public abstract class TestKeyedObjectPool {
         KeyedObjectPool<Object,Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -415,10 +415,10 @@ public abstract class TestKeyedObjectPool {
     public void testToString() throws Exception {
         final FailingKeyedPooledObjectFactory factory =
                 new FailingKeyedPooledObjectFactory();
-        KeyedObjectPool<Object,Object> pool = makeEmptyPool(factory);
+        final KeyedObjectPool<Object,Object> pool = makeEmptyPool(factory);
         try {
             pool.toString();
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         } finally {
             pool.close();
@@ -429,10 +429,10 @@ public abstract class TestKeyedObjectPool {
     public void testBaseBorrowReturn() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        final Object keya = makeKey(0);
         Object obj0 = _pool.borrowObject(keya);
         assertEquals(getNthObject(keya,0),obj0);
         Object obj1 = _pool.borrowObject(keya);
@@ -468,11 +468,11 @@ public abstract class TestKeyedObjectPool {
     public void testBaseBorrow() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
-        Object keyb = makeKey(1);
+        final Object keya = makeKey(0);
+        final Object keyb = makeKey(1);
         assertEquals("1",getNthObject(keya,0),_pool.borrowObject(keya));
         assertEquals("2",getNthObject(keyb,0),_pool.borrowObject(keyb));
         assertEquals("3",getNthObject(keyb,1),_pool.borrowObject(keyb));
@@ -486,16 +486,16 @@ public abstract class TestKeyedObjectPool {
     public void testBaseNumActiveNumIdle() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        final Object keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
+        final Object obj0 = _pool.borrowObject(keya);
         assertEquals(1,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj1 = _pool.borrowObject(keya);
+        final Object obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.returnObject(keya,obj1);
@@ -515,11 +515,11 @@ public abstract class TestKeyedObjectPool {
     public void testBaseNumActiveNumIdle2() throws Exception {
         try {
             _pool = makeEmptyPool(6);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
-        Object keyb = makeKey(1);
+        final Object keya = makeKey(0);
+        final Object keyb = makeKey(1);
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         assertEquals(0,_pool.getNumActive(keya));
@@ -527,8 +527,8 @@ public abstract class TestKeyedObjectPool {
         assertEquals(0,_pool.getNumActive(keyb));
         assertEquals(0,_pool.getNumIdle(keyb));
 
-        Object objA0 = _pool.borrowObject(keya);
-        Object objB0 = _pool.borrowObject(keyb);
+        final Object objA0 = _pool.borrowObject(keya);
+        final Object objB0 = _pool.borrowObject(keyb);
 
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
@@ -537,8 +537,8 @@ public abstract class TestKeyedObjectPool {
         assertEquals(1,_pool.getNumActive(keyb));
         assertEquals(0,_pool.getNumIdle(keyb));
 
-        Object objA1 = _pool.borrowObject(keya);
-        Object objB1 = _pool.borrowObject(keyb);
+        final Object objA1 = _pool.borrowObject(keya);
+        final Object objB1 = _pool.borrowObject(keyb);
 
         assertEquals(4,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
@@ -574,14 +574,14 @@ public abstract class TestKeyedObjectPool {
     public void testBaseClear() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        final Object keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
-        Object obj1 = _pool.borrowObject(keya);
+        final Object obj0 = _pool.borrowObject(keya);
+        final Object obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.returnObject(keya,obj1);
@@ -591,7 +591,7 @@ public abstract class TestKeyedObjectPool {
         _pool.clear(keya);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj2 = _pool.borrowObject(keya);
+        final Object obj2 = _pool.borrowObject(keya);
         assertEquals(getNthObject(keya,2),obj2);
         _pool.close();
     }
@@ -600,14 +600,14 @@ public abstract class TestKeyedObjectPool {
     public void testBaseInvalidateObject() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        final Object keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
-        Object obj1 = _pool.borrowObject(keya);
+        final Object obj0 = _pool.borrowObject(keya);
+        final Object obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.invalidateObject(keya,obj0);
@@ -623,10 +623,10 @@ public abstract class TestKeyedObjectPool {
     public void testBaseAddObject() throws Exception {
         try {
             _pool = makeEmptyPool(3);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object key = makeKey(0);
+        final Object key = makeKey(0);
         try {
             assertEquals(0,_pool.getNumIdle());
             assertEquals(0,_pool.getNumActive());
@@ -637,7 +637,7 @@ public abstract class TestKeyedObjectPool {
             assertEquals(0,_pool.getNumActive());
             assertEquals(1,_pool.getNumIdle(key));
             assertEquals(0,_pool.getNumActive(key));
-            Object obj = _pool.borrowObject(key);
+            final Object obj = _pool.borrowObject(key);
             assertEquals(getNthObject(key,0),obj);
             assertEquals(0,_pool.getNumIdle());
             assertEquals(1,_pool.getNumActive());
@@ -648,7 +648,7 @@ public abstract class TestKeyedObjectPool {
             assertEquals(0,_pool.getNumActive());
             assertEquals(1,_pool.getNumIdle(key));
             assertEquals(0,_pool.getNumActive(key));
-        } catch(UnsupportedOperationException e) {
+        } catch(final UnsupportedOperationException e) {
             return; // skip this test if one of those calls is unsupported
         } finally {
             _pool.close();
@@ -757,7 +757,7 @@ public abstract class TestKeyedObjectPool {
         public PooledObject<Object> makeObject(final Object key) throws Exception {
             final MethodCall call = new MethodCall("makeObject", key);
             methodCalls.add(call);
-            int originalCount = this.count++;
+            final int originalCount = this.count++;
             if (makeObjectFail) {
                 throw new PrivateException("makeObject");
             }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestObjectPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestObjectPool.java b/src/test/java/org/apache/commons/pool2/TestObjectPool.java
index fa7b449..8a679b4 100644
--- a/src/test/java/org/apache/commons/pool2/TestObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/TestObjectPool.java
@@ -56,25 +56,25 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        Object o1 = pool.borrowObject();
-        Object o2 = pool.borrowObject();
+        final Object o1 = pool.borrowObject();
+        final Object o2 = pool.borrowObject();
 
         pool.close();
 
         try {
             pool.addObject();
             fail("A closed pool must throw an IllegalStateException when addObject is called.");
-        } catch (IllegalStateException ise) {
+        } catch (final IllegalStateException ise) {
             // expected
         }
 
         try {
             pool.borrowObject();
             fail("A closed pool must throw an IllegalStateException when borrowObject is called.");
-        } catch (IllegalStateException ise) {
+        } catch (final IllegalStateException ise) {
             // expected
         }
 
@@ -114,7 +114,7 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch(UnsupportedOperationException uoe) {
+        } catch(final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -142,7 +142,7 @@ public abstract class TestObjectPool {
         try {
             pool.addObject();
             fail("Expected addObject to propagate makeObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject"));
@@ -156,7 +156,7 @@ public abstract class TestObjectPool {
         try {
             pool.addObject();
             fail("Expected addObject to propagate passivateObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject").returned(ONE));
@@ -176,7 +176,7 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         if (pool instanceof GenericObjectPool) {
@@ -204,7 +204,7 @@ public abstract class TestObjectPool {
         try {
             obj = pool.borrowObject();
             fail("Expected borrowObject to propagate makeObject exception.");
-        } catch (PrivateException pe) {
+        } catch (final PrivateException pe) {
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject"));
@@ -221,7 +221,7 @@ public abstract class TestObjectPool {
         try {
             pool.borrowObject();
             fail("Expecting NoSuchElementException");
-        } catch (NoSuchElementException ex) {
+        } catch (final NoSuchElementException ex) {
             // Expected - newly created object will also fail to activate
         }
         // Idle object fails activation, new one created, also fails
@@ -240,7 +240,7 @@ public abstract class TestObjectPool {
         expectedMethods.add(new MethodCall("validateObject", ZERO));
         try {
             pool.borrowObject();
-        } catch (NoSuchElementException ex) {
+        } catch (final NoSuchElementException ex) {
             // Expected - newly created object will also fail to validate
         }
         // Idle object is activated, but fails validation.
@@ -260,7 +260,7 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -321,7 +321,7 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -345,7 +345,7 @@ public abstract class TestObjectPool {
         try {
             pool.invalidateObject(obj);
             fail("Expecting destroy exception to propagate");
-        } catch (PrivateException ex) {
+        } catch (final PrivateException ex) {
             // Expected
         }
         Thread.sleep(250); // could be defered
@@ -360,7 +360,7 @@ public abstract class TestObjectPool {
         final ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -383,7 +383,7 @@ public abstract class TestObjectPool {
         ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
@@ -396,7 +396,7 @@ public abstract class TestObjectPool {
         //// Test exception handling close should swallow failures
         try {
             pool = makeEmptyPool(factory);
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         reset(pool, factory, expectedMethods);
@@ -410,7 +410,7 @@ public abstract class TestObjectPool {
         ObjectPool<Object> pool;
         try {
             pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
-        } catch (UnsupportedOperationException uoe) {
+        } catch (final UnsupportedOperationException uoe) {
             return; // test not supported
         }
         pool.toString();
@@ -418,9 +418,9 @@ public abstract class TestObjectPool {
     }
 
     static void removeDestroyObjectCall(List<MethodCall> calls) {
-        Iterator<MethodCall> iter = calls.iterator();
+        final Iterator<MethodCall> iter = calls.iterator();
         while (iter.hasNext()) {
-            MethodCall call = iter.next();
+            final MethodCall call = iter.next();
             if ("destroyObject".equals(call.getName())) {
                 iter.remove();
             }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/TestPoolUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/TestPoolUtils.java b/src/test/java/org/apache/commons/pool2/TestPoolUtils.java
index dc3ca3c..0667be1 100644
--- a/src/test/java/org/apache/commons/pool2/TestPoolUtils.java
+++ b/src/test/java/org/apache/commons/pool2/TestPoolUtils.java
@@ -64,23 +64,23 @@ public class TestPoolUtils {
     public void testCheckRethrow() {
         try {
             PoolUtils.checkRethrow(new Exception());
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             fail("PoolUtils.checkRethrow(Throwable) must rethrow only ThreadDeath and VirtualMachineError.");
         }
         try {
             PoolUtils.checkRethrow(new ThreadDeath());
             fail("PoolUtils.checkRethrow(Throwable) must rethrow ThreadDeath.");
-        } catch (ThreadDeath td) {
+        } catch (final ThreadDeath td) {
             // expected
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             fail("PoolUtils.checkRethrow(Throwable) must rethrow only ThreadDeath and VirtualMachineError.");
         }
         try {
             PoolUtils.checkRethrow(new InternalError()); // InternalError extends VirtualMachineError
             fail("PoolUtils.checkRethrow(Throwable) must rethrow VirtualMachineError.");
-        } catch (VirtualMachineError td) {
+        } catch (final VirtualMachineError td) {
             // expected
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             fail("PoolUtils.checkRethrow(Throwable) must rethrow only ThreadDeath and VirtualMachineError.");
         }
     }
@@ -95,7 +95,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.checkMinIdle(null, 1, 1);
             fail("PoolUtils.checkMinIdle(ObjectPool,,) must not allow null pool.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
         try {
@@ -103,7 +103,7 @@ public class TestPoolUtils {
             final ObjectPool<Object> pool = createProxy(ObjectPool.class, (List<String>)null);
             PoolUtils.checkMinIdle(pool, -1, 1);
             fail("PoolUtils.checkMinIdle(ObjectPool,,) must not accept negative min idle values.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -149,7 +149,7 @@ public class TestPoolUtils {
                 }
                 expectedMethods.add("toString");
                 assertEquals(expectedMethods, calledMethods); // may fail because of the thread scheduler
-            } catch (AssertionFailedError e) {
+            } catch (final AssertionFailedError e) {
                 afe = e;
             }
         } while (--triesLeft > 0 && afe != null);
@@ -163,7 +163,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.checkMinIdle(null, new Object(), 1, 1);
             fail("PoolUtils.checkMinIdle(KeyedObjectPool,Object,int,long) must not allow null pool.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
         try {
@@ -171,7 +171,7 @@ public class TestPoolUtils {
             final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.checkMinIdle(pool, (Object)null, 1, 1);
             fail("PoolUtils.checkMinIdle(KeyedObjectPool,Object,int,long) must not accept null keys.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
         try {
@@ -179,7 +179,7 @@ public class TestPoolUtils {
             final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.checkMinIdle(pool, new Object(), -1, 1);
             fail("PoolUtils.checkMinIdle(KeyedObjectPool,Object,int,long) must not accept negative min idle values.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -229,7 +229,7 @@ public class TestPoolUtils {
                 }
                 expectedMethods.add("toString");
                 assertEquals(expectedMethods, calledMethods); // may fail because of the thread scheduler
-            } catch (AssertionFailedError e) {
+            } catch (final AssertionFailedError e) {
                 afe = e;
             }
         } while (--triesLeft > 0 && afe != null);
@@ -245,7 +245,7 @@ public class TestPoolUtils {
             final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.checkMinIdle(pool, (Collection<?>) null, 1, 1);
             fail("PoolUtils.checkMinIdle(KeyedObjectPool,Collection,int,long) must not accept null keys.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -253,7 +253,7 @@ public class TestPoolUtils {
             @SuppressWarnings("unchecked")
             final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.checkMinIdle(pool, (Collection<?>) Collections.emptyList(), 1, 1);
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             fail("PoolUtils.checkMinIdle(KeyedObjectPool,Collection,int,long) must accept empty lists.");
         }
 
@@ -272,7 +272,7 @@ public class TestPoolUtils {
                 final Map<String, TimerTask> tasks = PoolUtils.checkMinIdle(pool, keys, 1, CHECK_PERIOD); // checks minIdle immediately
 
                 Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
-                for (TimerTask task : tasks.values()) {
+                for (final TimerTask task : tasks.values()) {
                     task.cancel();
                 }
 
@@ -282,7 +282,7 @@ public class TestPoolUtils {
                     expectedMethods.add("addObject");
                 }
                 assertEquals(expectedMethods, calledMethods); // may fail because of the thread scheduler
-            } catch (AssertionFailedError e) {
+            } catch (final AssertionFailedError e) {
                 afe = e;
             }
         } while (--triesLeft > 0 && afe != null);
@@ -296,7 +296,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.prefill(null, 1);
             fail("PoolUtils.prefill(ObjectPool,int) must not allow null pool.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -321,7 +321,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.prefill(null, new Object(), 1);
             fail("PoolUtils.prefill(KeyedObjectPool,Object,int) must not accept null pool.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
         try {
@@ -329,7 +329,7 @@ public class TestPoolUtils {
             final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.prefill(pool, (Object)null, 1);
             fail("PoolUtils.prefill(KeyedObjectPool,Object,int) must not accept null key.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -356,7 +356,7 @@ public class TestPoolUtils {
             final KeyedObjectPool<String,String> pool = createProxy(KeyedObjectPool.class, (List<String>)null);
             PoolUtils.prefill(pool, (Collection<String>)null, 1);
             fail("PoolUtils.prefill(KeyedObjectPool,Collection,int) must not accept null keys.");
-        } catch (IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // expected
         }
 
@@ -385,7 +385,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.synchronizedPool((ObjectPool<Object>)null);
             fail("PoolUtils.synchronizedPool(ObjectPool) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -405,7 +405,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.synchronizedPool((KeyedObjectPool<Object,Object>)null);
             fail("PoolUtils.synchronizedPool(KeyedObjectPool) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -425,7 +425,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.synchronizedPooledFactory((PooledObjectFactory<Object>)null);
             fail("PoolUtils.synchronizedPoolableFactory(PoolableObjectFactory) must not allow a null factory.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -446,7 +446,7 @@ public class TestPoolUtils {
         try {
             PoolUtils.synchronizedKeyedPooledFactory((KeyedPooledObjectFactory<Object,Object>)null);
             fail("PoolUtils.synchronizedPoolableFactory(KeyedPoolableObjectFactory) must not allow a null factory.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -467,14 +467,14 @@ public class TestPoolUtils {
         try {
             PoolUtils.erodingPool((ObjectPool<Object>)null);
             fail("PoolUtils.erodingPool(ObjectPool) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             PoolUtils.erodingPool((ObjectPool<Object>)null, 1f);
             fail("PoolUtils.erodingPool(ObjectPool, float) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -493,14 +493,15 @@ public class TestPoolUtils {
 
         try {
             @SuppressWarnings({"unchecked", "unused"})
+            final
             Object o = PoolUtils.erodingPool(createProxy(ObjectPool.class, handler), -1f);
             fail("PoolUtils.erodingPool(ObjectPool, float) must not allow a non-positive factor.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         // If the logic behind PoolUtils.erodingPool changes then this will need to be tweaked.
-        float factor = 0.01f; // about ~9 seconds until first discard
+        final float factor = 0.01f; // about ~9 seconds until first discard
         @SuppressWarnings("unchecked")
         final ObjectPool<Object> pool = PoolUtils.erodingPool(
                 createProxy(ObjectPool.class, handler), factor);
@@ -559,6 +560,7 @@ public class TestPoolUtils {
     @Test
     public void testErodingObjectPoolDefaultFactor() {
         @SuppressWarnings("unchecked")
+        final
         ObjectPool<Object> internalPool = createProxy(ObjectPool.class, new InvocationHandler() {
             @Override
             public Object invoke(Object arg0, Method arg1, Object[] arg2)
@@ -566,8 +568,8 @@ public class TestPoolUtils {
                 return null;
             }
         });
-        ObjectPool<Object> pool = PoolUtils.erodingPool(internalPool);
-        String expectedToString = "ErodingObjectPool{factor=ErodingFactor{factor=1.0, idleHighWaterMark=1}, pool=" + internalPool + "}";
+        final ObjectPool<Object> pool = PoolUtils.erodingPool(internalPool);
+        final String expectedToString = "ErodingObjectPool{factor=ErodingFactor{factor=1.0, idleHighWaterMark=1}, pool=" + internalPool + "}";
         // The factor is not exposed, but will be printed in the toString() method
         // In this case since we didn't pass one, the default 1.0f will be printed
         assertEquals(expectedToString, pool.toString());
@@ -578,21 +580,21 @@ public class TestPoolUtils {
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null);
             fail("PoolUtils.erodingPool(KeyedObjectPool) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null, 1f);
             fail("PoolUtils.erodingPool(KeyedObjectPool, float) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null, 1f, true);
             fail("PoolUtils.erodingPool(KeyedObjectPool, float, boolean) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -611,22 +613,24 @@ public class TestPoolUtils {
 
         try {
             @SuppressWarnings({"unchecked", "unused"})
+            final
             Object o = PoolUtils.erodingPool(createProxy(KeyedObjectPool.class, handler), 0f);
             fail("PoolUtils.erodingPool(ObjectPool, float) must not allow a non-positive factor.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             @SuppressWarnings({"unchecked", "unused"})
+            final
             Object o = PoolUtils.erodingPool(createProxy(KeyedObjectPool.class, handler), 0f, false);
             fail("PoolUtils.erodingPool(ObjectPool, float, boolean) must not allow a non-positive factor.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         // If the logic behind PoolUtils.erodingPool changes then this will need to be tweaked.
-        float factor = 0.01f; // about ~9 seconds until first discard
+        final float factor = 0.01f; // about ~9 seconds until first discard
         @SuppressWarnings("unchecked")
         final KeyedObjectPool<Object,Object> pool =
             PoolUtils.erodingPool(createProxy(KeyedObjectPool.class, handler), factor);
@@ -687,6 +691,7 @@ public class TestPoolUtils {
     @Test
     public void testErodingPoolKeyedObjectPoolDefaultFactor() {
         @SuppressWarnings("unchecked")
+        final
         KeyedObjectPool<Object, Object> internalPool = createProxy(KeyedObjectPool.class, new InvocationHandler() {
             @Override
             public Object invoke(Object arg0, Method arg1, Object[] arg2)
@@ -694,8 +699,8 @@ public class TestPoolUtils {
                 return null;
             }
         });
-        KeyedObjectPool<Object, Object> pool = PoolUtils.erodingPool(internalPool);
-        String expectedToString = "ErodingKeyedObjectPool{factor=ErodingFactor{factor=1.0, idleHighWaterMark=1}, keyedPool=" + internalPool + "}";
+        final KeyedObjectPool<Object, Object> pool = PoolUtils.erodingPool(internalPool);
+        final String expectedToString = "ErodingKeyedObjectPool{factor=ErodingFactor{factor=1.0, idleHighWaterMark=1}, keyedPool=" + internalPool + "}";
         // The factor is not exposed, but will be printed in the toString() method
         // In this case since we didn't pass one, the default 1.0f will be printed
         assertEquals(expectedToString, pool.toString());
@@ -706,21 +711,21 @@ public class TestPoolUtils {
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null, 1f, true);
             fail("PoolUtils.erodingPool(KeyedObjectPool) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null, 0f, true);
             fail("PoolUtils.erodingPool(ObjectPool, float, boolean) must not allow a non-positive factor.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
         try {
             PoolUtils.erodingPool((KeyedObjectPool<Object,Object>)null, 1f, true);
             fail("PoolUtils.erodingPool(KeyedObjectPool, float, boolean) must not allow a null pool.");
-        } catch(IllegalArgumentException iae) {
+        } catch(final IllegalArgumentException iae) {
             // expected
         }
 
@@ -738,7 +743,7 @@ public class TestPoolUtils {
         };
 
         // If the logic behind PoolUtils.erodingPool changes then this will need to be tweaked.
-        float factor = 0.01f; // about ~9 seconds until first discard
+        final float factor = 0.01f; // about ~9 seconds until first discard
         @SuppressWarnings("unchecked")
         final KeyedObjectPool<Object,Object> pool = PoolUtils.erodingPool(
                 createProxy(KeyedObjectPool.class, handler), factor, true);
@@ -782,7 +787,7 @@ public class TestPoolUtils {
         expectedMethods.add("invalidateObject");
         assertEquals(expectedMethods, calledMethods);
 
-        String expectedToString = "ErodingPerKeyKeyedObjectPool{factor="+factor+", keyedPool=null}";
+        final String expectedToString = "ErodingPerKeyKeyedObjectPool{factor="+factor+", keyedPool=null}";
         assertEquals(expectedToString, pool.toString());
     }
 
@@ -791,7 +796,7 @@ public class TestPoolUtils {
      */
     @Test
     public void testTimerHolder() {
-        PoolUtils.TimerHolder h = new PoolUtils.TimerHolder();
+        final PoolUtils.TimerHolder h = new PoolUtils.TimerHolder();
         assertNotNull(h);
         assertNotNull(PoolUtils.TimerHolder.MIN_IDLE_TIMER);
     }
@@ -873,6 +878,7 @@ public class TestPoolUtils {
 
     private static <T> T createProxy(final Class<T> clazz, final InvocationHandler handler) {
         @SuppressWarnings("unchecked")
+        final
         T ret = (T) Proxy.newProxyInstance(
                 clazz.getClassLoader(), new Class[] { clazz }, handler);
         return ret;

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/Waiter.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/Waiter.java b/src/test/java/org/apache/commons/pool2/Waiter.java
index 1c310a6..fe8e689 100644
--- a/src/test/java/org/apache/commons/pool2/Waiter.java
+++ b/src/test/java/org/apache/commons/pool2/Waiter.java
@@ -50,7 +50,7 @@ public class Waiter {
     public void doWait() {
         try {
             Thread.sleep(latency);
-        } catch (InterruptedException ex) {
+        } catch (final InterruptedException ex) {
             // ignore
         }
     }
@@ -166,7 +166,7 @@ public class Waiter {
 
     @Override
     public String toString() {
-        StringBuilder buff = new StringBuilder();
+        final StringBuilder buff = new StringBuilder();
         buff.append("ID = " + id + "\n");
         buff.append("valid = " + valid + "\n");
         buff.append("active = " + active + "\n");

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/WaiterFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/WaiterFactory.java b/src/test/java/org/apache/commons/pool2/WaiterFactory.java
index c942b47..7727e25 100644
--- a/src/test/java/org/apache/commons/pool2/WaiterFactory.java
+++ b/src/test/java/org/apache/commons/pool2/WaiterFactory.java
@@ -148,7 +148,7 @@ KeyedPooledObjectFactory<K,Waiter> {
         }
         try {
             Thread.sleep(latency);
-        } catch (InterruptedException ex) {
+        } catch (final InterruptedException ex) {
             // ignore
         }
     }
@@ -158,9 +158,9 @@ KeyedPooledObjectFactory<K,Waiter> {
         if (activeCounts.isEmpty()) {
             return;
         }
-        Iterator<K> it = activeCounts.keySet().iterator();
+        final Iterator<K> it = activeCounts.keySet().iterator();
         while (it.hasNext()) {
-            K key = it.next();
+            final K key = it.next();
             activeCounts.put(key, Integer.valueOf(0));
         }
     }
@@ -183,7 +183,7 @@ KeyedPooledObjectFactory<K,Waiter> {
     public void destroyObject(K key,PooledObject<Waiter> obj) throws Exception {
         destroyObject(obj);
         synchronized (this) {
-            Integer count = activeCounts.get(key);
+            final Integer count = activeCounts.get(key);
             activeCounts.put(key, Integer.valueOf(count.intValue() - 1));
         }
     }

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java
index bd39814..3c0ef81 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java
@@ -62,20 +62,20 @@ public class TestAbandonedObjectPool {
 
     @After
     public void tearDown() throws Exception {
-        String poolName = pool.getJmxName().toString();
+        final String poolName = pool.getJmxName().toString();
         pool.clear();
         pool.close();
         pool = null;
 
-        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-        Set<ObjectName> result = mbs.queryNames(new ObjectName(
+        final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+        final Set<ObjectName> result = mbs.queryNames(new ObjectName(
                 "org.apache.commoms.pool2:type=GenericObjectPool,*"), null);
         // There should be no registered pools at this point
-        int registeredPoolCount = result.size();
-        StringBuilder msg = new StringBuilder("Current pool is: ");
+        final int registeredPoolCount = result.size();
+        final StringBuilder msg = new StringBuilder("Current pool is: ");
         msg.append(poolName);
         msg.append("  Still open pools are: ");
-        for (ObjectName name : result) {
+        for (final ObjectName name : result) {
             // Clean these up ready for the next test
             msg.append(name.toString());
             msg.append(" created via\n");
@@ -100,7 +100,7 @@ public class TestAbandonedObjectPool {
         pool.setBlockWhenExhausted(false);
 
         // Exhaust the connection pool
-        ArrayList<PooledTestObject> vec = new ArrayList<PooledTestObject>();
+        final ArrayList<PooledTestObject> vec = new ArrayList<PooledTestObject>();
         for (int i = 0; i < POOL_SIZE; i++) {
             vec.add(pool.borrowObject());
         }
@@ -112,7 +112,7 @@ public class TestAbandonedObjectPool {
 
         // Try launching a bunch of borrows concurrently.  Abandoned sweep will be triggered for each.
         final int CONCURRENT_BORROWS = 5;
-        Thread[] threads = new Thread[CONCURRENT_BORROWS];
+        final Thread[] threads = new Thread[CONCURRENT_BORROWS];
         for (int i = 0; i < CONCURRENT_BORROWS; i++) {
             threads[i] = new ConcurrentBorrower(vec);
             threads[i].start();
@@ -125,7 +125,7 @@ public class TestAbandonedObjectPool {
 
         // Return all objects that have not been destroyed
         for (int i = 0; i < vec.size(); i++) {
-            PooledTestObject pto = vec.get(i);
+            final PooledTestObject pto = vec.get(i);
             if (pto.isActive()) {
                 pool.returnObject(pto);
             }
@@ -162,7 +162,7 @@ public class TestAbandonedObjectPool {
             throw new NullPointerException("Unable to borrow object from pool");
         }
         final int deadMansHash = obj.hashCode();
-        ConcurrentReturner returner = new ConcurrentReturner(obj);
+        final ConcurrentReturner returner = new ConcurrentReturner(obj);
         Thread.sleep(2000);  // abandon checked out instances
         // Now start a race - returner waits until borrowObject has kicked
         // off removeAbandoned and then returns an instance that borrowObject
@@ -228,10 +228,10 @@ public class TestAbandonedObjectPool {
         // Borrow an object, wait long enough for it to be abandoned
         // then arrange for evictor to run while it is being returned
         // validation takes a second, evictor runs every 500 ms
-        PooledTestObject obj = pool.borrowObject();
+        final PooledTestObject obj = pool.borrowObject();
         Thread.sleep(50);       // abandon obj
         pool.returnObject(obj); // evictor will run during validation
-        PooledTestObject obj2 = pool.borrowObject();
+        final PooledTestObject obj2 = pool.borrowObject();
         Assert.assertEquals(obj, obj2);          // should get original back
         Assert.assertTrue(!obj2.isDestroyed());  // and not destroyed
     }
@@ -254,11 +254,12 @@ public class TestAbandonedObjectPool {
         pool.setMaxTotal(1);
 
         @SuppressWarnings("unused") // This is going to be abandoned
+        final
         PooledTestObject o1 = pool.borrowObject();
 
-        long start = System.currentTimeMillis();
-        PooledTestObject o2 = pool.borrowObject(5000);
-        long end = System.currentTimeMillis();
+        final long start = System.currentTimeMillis();
+        final PooledTestObject o2 = pool.borrowObject(5000);
+        final long end = System.currentTimeMillis();
 
         pool.returnObject(o2);
 
@@ -273,12 +274,12 @@ public class TestAbandonedObjectPool {
         abandonedConfig.setRemoveAbandonedOnMaintenance(true);
         abandonedConfig.setLogAbandoned(true);
         abandonedConfig.setRemoveAbandonedTimeout(1);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintWriter pw = new PrintWriter(new BufferedOutputStream(baos));
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final PrintWriter pw = new PrintWriter(new BufferedOutputStream(baos));
         abandonedConfig.setLogWriter(pw);
         pool.setAbandonedConfig(abandonedConfig);
         pool.setTimeBetweenEvictionRunsMillis(100);
-        PooledTestObject o1 = pool.borrowObject();
+        final PooledTestObject o1 = pool.borrowObject();
         Thread.sleep(2000);
         Assert.assertTrue(o1.isDestroyed());
         Assert.assertTrue(baos.toString().indexOf("Pooled object") >= 0);
@@ -295,7 +296,7 @@ public class TestAbandonedObjectPool {
         public void run() {
             try {
                 _borrowed.add(pool.borrowObject());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // expected in most cases
             }
         }
@@ -311,7 +312,7 @@ public class TestAbandonedObjectPool {
             try {
                 sleep(20);
                 pool.returnObject(returned);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // ignore
             }
         }
@@ -341,7 +342,7 @@ public class TestAbandonedObjectPool {
         public boolean validateObject(PooledObject<PooledTestObject> obj) {
             try {
                 Thread.sleep(validateLatency);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // ignore
             }
             return true;

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
index c57173b..449bb1f 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
@@ -46,7 +46,7 @@ public class TestBaseGenericObjectPool {
     
     @Test
     public void testBorrowWaitStatistics() {
-        DefaultPooledObject<String> p = (DefaultPooledObject<String>) factory.makeObject();
+        final DefaultPooledObject<String> p = (DefaultPooledObject<String>) factory.makeObject();
         pool.updateStatsBorrow(p, 10);
         pool.updateStatsBorrow(p, 20);
         pool.updateStatsBorrow(p, 20);
@@ -56,7 +56,7 @@ public class TestBaseGenericObjectPool {
     }
 
     public void testBorrowWaitStatisticsMax() {
-        DefaultPooledObject<String> p = (DefaultPooledObject<String>) factory.makeObject();
+        final DefaultPooledObject<String> p = (DefaultPooledObject<String>) factory.makeObject();
         Assert.assertEquals(0, pool.getMaxBorrowWaitTimeMillis(), Double.MIN_VALUE);
         pool.updateStatsBorrow(p, 0);
         Assert.assertEquals(0, pool.getMaxBorrowWaitTimeMillis(), Double.MIN_VALUE);

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
index 91c8492..07f1629 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
@@ -36,9 +36,9 @@ public class TestDefaultPooledObject {
     public void testgetIdleTimeMillis() throws Exception {
         final DefaultPooledObject<Object> dpo = new DefaultPooledObject<Object>(new Object());
         final AtomicBoolean negativeIdleTimeReturned = new AtomicBoolean(false);
-        ExecutorService executor = Executors.newFixedThreadPool(
+        final ExecutorService executor = Executors.newFixedThreadPool(
                                       Runtime.getRuntime().availableProcessors()*3);
-        Runnable allocateAndDeallocateTask = new Runnable() {
+        final Runnable allocateAndDeallocateTask = new Runnable() {
             public void run() {
                 for (int i=0;i<10000;i++) {
                     if (dpo.getIdleTimeMillis() < 0) {
@@ -56,7 +56,7 @@ public class TestDefaultPooledObject {
                 dpo.deallocate();
             }
         };
-        Runnable getIdleTimeTask = new Runnable() {
+        final Runnable getIdleTimeTask = new Runnable() {
             public void run() {
                 for (int i=0;i<10000;i++) {
                     if (dpo.getIdleTimeMillis() < 0) {
@@ -66,14 +66,14 @@ public class TestDefaultPooledObject {
                 }
             }
         };
-        double probabilityOfAllocationTask = 0.7;
-        List<Future<?>> futures = new ArrayList<Future<?>>();
+        final double probabilityOfAllocationTask = 0.7;
+        final List<Future<?>> futures = new ArrayList<Future<?>>();
         for (int i = 1; i <= 10000; i++) {
-            Runnable randomTask = Math.random() < probabilityOfAllocationTask ?
+            final Runnable randomTask = Math.random() < probabilityOfAllocationTask ?
                                   allocateAndDeallocateTask : getIdleTimeTask;
             futures.add(executor.submit(randomTask));
         }
-        for (Future<?> future: futures) {
+        for (final Future<?> future: futures) {
             future.get();
         }
         Assert.assertFalse(

http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java
index 8aa8389..584dd82 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java
@@ -28,36 +28,36 @@ public class TestDefaultPooledObjectInfo {
 
     @Test
     public void testTiming() throws Exception {
-        GenericObjectPool<String> pool =
+        final GenericObjectPool<String> pool =
                 new GenericObjectPool<String>(new SimpleFactory());
 
-        long t1 = System.currentTimeMillis();
+        final long t1 = System.currentTimeMillis();
 
         Thread.sleep(50);
-        String s1 = pool.borrowObject();
+        final String s1 = pool.borrowObject();
         Thread.sleep(50);
 
-        long t2 = System.currentTimeMillis();
+        final long t2 = System.currentTimeMillis();
 
         Thread.sleep(50);
         pool.returnObject(s1);
         Thread.sleep(50);
 
-        long t3 = System.currentTimeMillis();
+        final long t3 = System.currentTimeMillis();
 
         Thread.sleep(50);
         pool.borrowObject();
         Thread.sleep(50);
 
-        long t4 = System.currentTimeMillis();
+        final long t4 = System.currentTimeMillis();
 
-        Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
+        final Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
 
         Assert.assertEquals(1, strings.size());
 
-        DefaultPooledObjectInfo s1Info = strings.iterator().next();
+        final DefaultPooledObjectInfo s1Info = strings.iterator().next();
 
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
 
         Assert.assertTrue(s1Info.getCreateTime() > t1);
         Assert.assertEquals(sdf.format(Long.valueOf(s1Info.getCreateTime())),
@@ -77,16 +77,16 @@ public class TestDefaultPooledObjectInfo {
 
     @Test
     public void testGetPooledObjectType() throws Exception {
-        GenericObjectPool<String> pool =
+        final GenericObjectPool<String> pool =
                 new GenericObjectPool<String>(new SimpleFactory());
 
         pool.borrowObject();
 
-        Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
+        final Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
 
         Assert.assertEquals(1, strings.size());
 
-        DefaultPooledObjectInfo s1Info = strings.iterator().next();
+        final DefaultPooledObjectInfo s1Info = strings.iterator().next();
 
         Assert.assertEquals(String.class.getName(),
                 s1Info.getPooledObjectType());
@@ -94,28 +94,28 @@ public class TestDefaultPooledObjectInfo {
 
     @Test
     public void testGetPooledObjectToString() throws Exception {
-        GenericObjectPool<String> pool =
+        final GenericObjectPool<String> pool =
                 new GenericObjectPool<String>(new SimpleFactory());
 
-        String s1 = pool.borrowObject();
+        final String s1 = pool.borrowObject();
 
-        Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
+        final Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
 
         Assert.assertEquals(1, strings.size());
 
-        DefaultPooledObjectInfo s1Info = strings.iterator().next();
+        final DefaultPooledObjectInfo s1Info = strings.iterator().next();
 
         Assert.assertEquals(s1, s1Info.getPooledObjectToString());
     }
 
     @Test
     public void testGetLastBorrowTrace() throws Exception {
-        AbandonedConfig abandonedConfig = new AbandonedConfig();
+        final AbandonedConfig abandonedConfig = new AbandonedConfig();
 
         abandonedConfig.setRemoveAbandonedOnBorrow(true);
         abandonedConfig.setRemoveAbandonedTimeout(1);
         abandonedConfig.setLogAbandoned(true);
-        GenericObjectPool<String> pool = new GenericObjectPool<String>(
+        final GenericObjectPool<String> pool = new GenericObjectPool<String>(
                 new SimpleFactory(),
                 new GenericObjectPoolConfig(),
                 abandonedConfig);
@@ -123,13 +123,13 @@ public class TestDefaultPooledObjectInfo {
         try {
             pool.borrowObject();
             //pool.returnObject(s1); // Object not returned, causes abandoned object created exception
-        } catch (AbandonedObjectCreatedException e) {
+        } catch (final AbandonedObjectCreatedException e) {
             // do nothing. We will print the stack trace later
         }
 
-        Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
-        DefaultPooledObjectInfo s1Info = strings.iterator().next();
-        String lastBorrowTrace = s1Info.getLastBorrowTrace();
+        final Set<DefaultPooledObjectInfo> strings = pool.listAllObjects();
+        final DefaultPooledObjectInfo s1Info = strings.iterator().next();
+        final String lastBorrowTrace = s1Info.getLastBorrowTrace();
 
         Assert.assertTrue(lastBorrowTrace.startsWith(AbandonedObjectCreatedException.class.getName()));
     }


Mime
View raw message