commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1729267 [1/4] - in /commons/proper/pool/trunk/src: main/java/org/apache/commons/pool2/ main/java/org/apache/commons/pool2/impl/ main/java/org/apache/commons/pool2/proxy/ test/java/org/apache/commons/pool2/ test/java/org/apache/commons/pool...
Date Mon, 08 Feb 2016 21:45:13 GMT
Author: ggregory
Date: Mon Feb  8 21:45:12 2016
New Revision: 1729267

URL: http://svn.apache.org/viewvc?rev=1729267&view=rev
Log:
Add final modifier to local variables.

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/BaseObject.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionConfig.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/InterruptibleReentrantLock.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/proxy/JdkProxySource.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/MethodCallPoolableObjectFactory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestBaseKeyedPoolableObjectFactory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestBaseObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestBasePoolableObjectFactory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/TestPoolUtils.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/Waiter.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/WaiterFactory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestAbandonedObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestBaseGenericObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObject.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestDefaultPooledObjectInfo.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPoolClassLoaders.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestLinkedBlockingDeque.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestPoolImplUtils.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestPooledSoftReference.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/SleepingObjectFactory.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/proxy/BaseTestProxiedKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/proxy/BaseTestProxiedObjectPool.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/BaseObject.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/BaseObject.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/BaseObject.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/BaseObject.java Mon Feb  8 21:45:12 2016
@@ -25,7 +25,7 @@ public abstract class BaseObject {
 
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append(getClass().getSimpleName());
         builder.append(" [");
         toStringAppendFields(builder);

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java Mon Feb  8 21:45:12 2016
@@ -605,7 +605,7 @@ public final class PoolUtils {
                 }
                 success = true;
 
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 cancel();
             } finally {
                 // detect other types of Throwable and cancel this Timer
@@ -680,7 +680,7 @@ public final class PoolUtils {
                 }
                 success = true;
 
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 cancel();
 
             } finally {
@@ -752,7 +752,7 @@ public final class PoolUtils {
         @Override
         public T borrowObject() throws Exception, NoSuchElementException,
                 IllegalStateException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 return pool.borrowObject();
@@ -766,11 +766,11 @@ public final class PoolUtils {
          */
         @Override
         public void returnObject(final T obj) {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 pool.returnObject(obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed as of Pool 2
             } finally {
                 writeLock.unlock();
@@ -782,11 +782,11 @@ public final class PoolUtils {
          */
         @Override
         public void invalidateObject(final T obj) {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 pool.invalidateObject(obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed as of Pool 2
             } finally {
                 writeLock.unlock();
@@ -799,7 +799,7 @@ public final class PoolUtils {
         @Override
         public void addObject() throws Exception, IllegalStateException,
                 UnsupportedOperationException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 pool.addObject();
@@ -813,7 +813,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumIdle() {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return pool.getNumIdle();
@@ -827,7 +827,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumActive() {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return pool.getNumActive();
@@ -841,7 +841,7 @@ public final class PoolUtils {
          */
         @Override
         public void clear() throws Exception, UnsupportedOperationException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 pool.clear();
@@ -855,11 +855,11 @@ public final class PoolUtils {
          */
         @Override
         public void close() {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 pool.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed as of Pool 2
             } finally {
                 writeLock.unlock();
@@ -926,7 +926,7 @@ public final class PoolUtils {
         @Override
         public V borrowObject(final K key) throws Exception,
                 NoSuchElementException, IllegalStateException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 return keyedPool.borrowObject(key);
@@ -940,11 +940,11 @@ public final class PoolUtils {
          */
         @Override
         public void returnObject(final K key, final V obj) {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.returnObject(key, obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             } finally {
                 writeLock.unlock();
@@ -956,11 +956,11 @@ public final class PoolUtils {
          */
         @Override
         public void invalidateObject(final K key, final V obj) {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.invalidateObject(key, obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed as of Pool 2
             } finally {
                 writeLock.unlock();
@@ -973,7 +973,7 @@ public final class PoolUtils {
         @Override
         public void addObject(final K key) throws Exception,
                 IllegalStateException, UnsupportedOperationException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.addObject(key);
@@ -987,7 +987,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumIdle(final K key) {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return keyedPool.getNumIdle(key);
@@ -1001,7 +1001,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumActive(final K key) {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return keyedPool.getNumActive(key);
@@ -1015,7 +1015,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumIdle() {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return keyedPool.getNumIdle();
@@ -1029,7 +1029,7 @@ public final class PoolUtils {
          */
         @Override
         public int getNumActive() {
-            ReadLock readLock = readWriteLock.readLock();
+            final ReadLock readLock = readWriteLock.readLock();
             readLock.lock();
             try {
                 return keyedPool.getNumActive();
@@ -1043,7 +1043,7 @@ public final class PoolUtils {
          */
         @Override
         public void clear() throws Exception, UnsupportedOperationException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.clear();
@@ -1058,7 +1058,7 @@ public final class PoolUtils {
         @Override
         public void clear(final K key) throws Exception,
                 UnsupportedOperationException {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.clear(key);
@@ -1072,11 +1072,11 @@ public final class PoolUtils {
          */
         @Override
         public void close() {
-            WriteLock writeLock = readWriteLock.writeLock();
+            final WriteLock writeLock = readWriteLock.writeLock();
             writeLock.lock();
             try {
                 keyedPool.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed as of Pool 2
             } finally {
                 writeLock.unlock();
@@ -1466,7 +1466,7 @@ public final class PoolUtils {
                 } else {
                     pool.returnObject(obj);
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }
@@ -1478,7 +1478,7 @@ public final class PoolUtils {
         public void invalidateObject(final T obj) {
             try {
                 pool.invalidateObject(obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }
@@ -1523,7 +1523,7 @@ public final class PoolUtils {
         public void close() {
             try {
                 pool.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }
@@ -1631,7 +1631,7 @@ public final class PoolUtils {
                 } else {
                     keyedPool.returnObject(key, obj);
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }
@@ -1654,7 +1654,7 @@ public final class PoolUtils {
         public void invalidateObject(final K key, final V obj) {
             try {
                 keyedPool.invalidateObject(key, obj);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }
@@ -1724,7 +1724,7 @@ public final class PoolUtils {
         public void close() {
             try {
                 keyedPool.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // swallowed
             }
         }

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java Mon Feb  8 21:45:12 2016
@@ -235,7 +235,7 @@ public class AbandonedConfig {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("AbandonedConfig [removeAbandonedOnBorrow=");
         builder.append(removeAbandonedOnBorrow);
         builder.append(", removeAbandonedOnMaintenance=");

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java Mon Feb  8 21:45:12 2016
@@ -141,7 +141,7 @@ public abstract class BaseGenericObjectP
         this.creationStackTrace = getStackTrace(new Exception());
 
         // save the current TCCL (if any) to be used later by the evictor Thread
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
         if (cl == null) {
             factoryClassLoader = null;
         } else {
@@ -604,24 +604,25 @@ public abstract class BaseGenericObjectP
             try {
                 clazz = Class.forName(evictionPolicyClassName, true,
                         Thread.currentThread().getContextClassLoader());
-            } catch (ClassNotFoundException e) {
+            } catch (final ClassNotFoundException e) {
                 clazz = Class.forName(evictionPolicyClassName);
             }
-            Object policy = clazz.newInstance();
+            final Object policy = clazz.newInstance();
             if (policy instanceof EvictionPolicy<?>) {
                 @SuppressWarnings("unchecked") // safe, because we just checked the class
+                final
                 EvictionPolicy<T> evicPolicy = (EvictionPolicy<T>) policy;
                 this.evictionPolicy = evicPolicy;
             }
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new IllegalArgumentException(
                     "Unable to create EvictionPolicy instance of type " +
                     evictionPolicyClassName, e);
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             throw new IllegalArgumentException(
                     "Unable to create EvictionPolicy instance of type " +
                     evictionPolicyClassName, e);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             throw new IllegalArgumentException(
                     "Unable to create EvictionPolicy instance of type " +
                     evictionPolicyClassName, e);
@@ -860,7 +861,7 @@ public abstract class BaseGenericObjectP
      * @param e exception to be swallowed
      */
     final void swallowException(Exception e) {
-        SwallowedExceptionListener listener = getSwallowedExceptionListener();
+        final SwallowedExceptionListener listener = getSwallowedExceptionListener();
 
         if (listener == null) {
             return;
@@ -868,11 +869,11 @@ public abstract class BaseGenericObjectP
 
         try {
             listener.onSwallowException(e);
-        } catch (OutOfMemoryError oome) {
+        } catch (final OutOfMemoryError oome) {
             throw oome;
-        } catch (VirtualMachineError vme) {
+        } catch (final VirtualMachineError vme) {
             throw vme;
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             // Ignore. Enjoy the irony.
         }
     }
@@ -915,9 +916,9 @@ public abstract class BaseGenericObjectP
             try {
                 ManagementFactory.getPlatformMBeanServer().unregisterMBean(
                         oname);
-            } catch (MBeanRegistrationException e) {
+            } catch (final MBeanRegistrationException e) {
                 swallowException(e);
-            } catch (InstanceNotFoundException e) {
+            } catch (final InstanceNotFoundException e) {
                 swallowException(e);
             }
         }
@@ -939,7 +940,7 @@ public abstract class BaseGenericObjectP
     private ObjectName jmxRegister(BaseObjectPoolConfig config,
             String jmxNameBase, String jmxNamePrefix) {
         ObjectName objectName = null;
-        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+        final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         int i = 1;
         boolean registered = false;
         String base = config.getJmxNameBase();
@@ -959,7 +960,7 @@ public abstract class BaseGenericObjectP
                 mbs.registerMBean(this, objName);
                 objectName = objName;
                 registered = true;
-            } catch (MalformedObjectNameException e) {
+            } catch (final MalformedObjectNameException e) {
                 if (BaseObjectPoolConfig.DEFAULT_JMX_NAME_PREFIX.equals(
                         jmxNamePrefix) && jmxNameBase.equals(base)) {
                     // Shouldn't happen. Skip registration if it does.
@@ -970,13 +971,13 @@ public abstract class BaseGenericObjectP
                             BaseObjectPoolConfig.DEFAULT_JMX_NAME_PREFIX;
                     base = jmxNameBase;
                 }
-            } catch (InstanceAlreadyExistsException e) {
+            } catch (final InstanceAlreadyExistsException e) {
                 // Increment the index and try again
                 i++;
-            } catch (MBeanRegistrationException e) {
+            } catch (final MBeanRegistrationException e) {
                 // Shouldn't happen. Skip registration if it does.
                 registered = true;
-            } catch (NotCompliantMBeanException e) {
+            } catch (final NotCompliantMBeanException e) {
                 // Shouldn't happen. Skip registration if it does.
                 registered = true;
             }
@@ -993,8 +994,8 @@ public abstract class BaseGenericObjectP
         // Need the exception in string form to prevent the retention of
         // references to classes in the stack trace that could trigger a memory
         // leak in a container environment.
-        Writer w = new StringWriter();
-        PrintWriter pw = new PrintWriter(w);
+        final Writer w = new StringWriter();
+        final PrintWriter pw = new PrintWriter(w);
         e.printStackTrace(pw);
         return w.toString();
     }
@@ -1017,12 +1018,12 @@ public abstract class BaseGenericObjectP
          */
         @Override
         public void run() {
-            ClassLoader savedClassLoader =
+            final ClassLoader savedClassLoader =
                     Thread.currentThread().getContextClassLoader();
             try {
                 if (factoryClassLoader != null) {
                     // Set the class loader for the factory
-                    ClassLoader cl = factoryClassLoader.get();
+                    final ClassLoader cl = factoryClassLoader.get();
                     if (cl == null) {
                         // The pool has been dereferenced and the class loader
                         // GC'd. Cancel this timer so the pool can be GC'd as
@@ -1036,9 +1037,9 @@ public abstract class BaseGenericObjectP
                 // Evict from the pool
                 try {
                     evict();
-                } catch(Exception e) {
+                } catch(final Exception e) {
                     swallowException(e);
-                } catch(OutOfMemoryError oome) {
+                } catch(final OutOfMemoryError oome) {
                     // Log problem but give evictor thread a chance to continue
                     // in case error is recoverable
                     oome.printStackTrace(System.err);
@@ -1046,7 +1047,7 @@ public abstract class BaseGenericObjectP
                 // Re-create idle instances.
                 try {
                     ensureMinIdle();
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
             } finally {
@@ -1102,7 +1103,7 @@ public abstract class BaseGenericObjectP
             double result = 0;
             int counter = 0;
             for (int i = 0; i < size; i++) {
-                long value = values[i].get();
+                final long value = values[i].get();
                 if (value != -1) {
                     counter++;
                     result = result * ((counter - 1) / (double) counter) +
@@ -1114,7 +1115,7 @@ public abstract class BaseGenericObjectP
 
         @Override
         public String toString() {
-            StringBuilder builder = new StringBuilder();
+            final StringBuilder builder = new StringBuilder();
             builder.append("StatsStore [values=");
             builder.append(Arrays.toString(values));
             builder.append(", size=");
@@ -1218,7 +1219,7 @@ public abstract class BaseGenericObjectP
 
         @Override
         public String toString() {
-            StringBuilder builder = new StringBuilder();
+            final StringBuilder builder = new StringBuilder();
             builder.append("IdentityWrapper [instance=");
             builder.append(instance);
             builder.append("]");

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java Mon Feb  8 21:45:12 2016
@@ -73,8 +73,8 @@ public class DefaultPooledObject<T> impl
     @Override
     public long getActiveTimeMillis() {
         // Take copies to avoid threading issues
-        long rTime = lastReturnTime;
-        long bTime = lastBorrowTime;
+        final long rTime = lastReturnTime;
+        final long bTime = lastBorrowTime;
 
         if (rTime > bTime) {
             return rTime - bTime;
@@ -143,7 +143,7 @@ public class DefaultPooledObject<T> impl
 
     @Override
     public String toString() {
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
         result.append("Object: ");
         result.append(object.toString());
         result.append(", State: ");
@@ -242,12 +242,12 @@ public class DefaultPooledObject<T> impl
     @Override
     public void printStackTrace(PrintWriter writer) {
         boolean written = false;
-        Exception borrowedByCopy = this.borrowedBy;
+        final Exception borrowedByCopy = this.borrowedBy;
         if (borrowedByCopy != null) {
             borrowedByCopy.printStackTrace(writer);
             written = true;
         }
-        Exception usedByCopy = this.usedBy;
+        final Exception usedByCopy = this.usedBy;
         if (usedByCopy != null) {
             usedByCopy.printStackTrace(writer);
             written = true;

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java Mon Feb  8 21:45:12 2016
@@ -48,7 +48,7 @@ public class DefaultPooledObjectInfo imp
 
     @Override
     public String getCreateTimeFormatted() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
         return sdf.format(Long.valueOf(pooledObject.getCreateTime()));
     }
 
@@ -59,13 +59,13 @@ public class DefaultPooledObjectInfo imp
 
     @Override
     public String getLastBorrowTimeFormatted() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
         return sdf.format(Long.valueOf(pooledObject.getLastBorrowTime()));
     }
 
     @Override
     public String getLastBorrowTrace() {
-        StringWriter sw = new StringWriter();
+        final StringWriter sw = new StringWriter();
         pooledObject.printStackTrace(new PrintWriter(sw));
         return sw.toString();
     }
@@ -77,7 +77,7 @@ public class DefaultPooledObjectInfo imp
 
     @Override
     public String getLastReturnTimeFormatted() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
         return sdf.format(Long.valueOf(pooledObject.getLastReturnTime()));
     }
 
@@ -105,7 +105,7 @@ public class DefaultPooledObjectInfo imp
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("DefaultPooledObjectInfo [pooledObject=");
         builder.append(pooledObject);
         builder.append("]");

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionConfig.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionConfig.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionConfig.java Mon Feb  8 21:45:12 2016
@@ -103,7 +103,7 @@ public class EvictionConfig {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("EvictionConfig [idleEvictTime=");
         builder.append(idleEvictTime);
         builder.append(", idleSoftEvictTime=");

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java Mon Feb  8 21:45:12 2016
@@ -62,7 +62,7 @@ class EvictionTimer {
         if (null == _timer) {
             // Force the new Timer thread to be created with a context class
             // loader set to the class loader that loaded this library
-            ClassLoader ccl = AccessController.doPrivileged(
+            final ClassLoader ccl = AccessController.doPrivileged(
                     new PrivilegedGetTccl());
             try {
                 AccessController.doPrivileged(new PrivilegedSetTccl(
@@ -130,7 +130,7 @@ class EvictionTimer {
 
         @Override
         public String toString() {
-            StringBuilder builder = new StringBuilder();
+            final StringBuilder builder = new StringBuilder();
             builder.append("PrivilegedSetTccl [classLoader=");
             builder.append(classLoader);
             builder.append("]");
@@ -162,7 +162,7 @@ class EvictionTimer {
      */
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
+        final StringBuilder builder = new StringBuilder();
         builder.append("EvictionTimer []");
         return builder.toString();
     }

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java Mon Feb  8 21:45:12 2016
@@ -222,7 +222,7 @@ public class GenericKeyedObjectPool<K,T>
      */
     @Override
     public int getMinIdlePerKey() {
-        int maxIdlePerKeySave = getMaxIdlePerKey();
+        final int maxIdlePerKeySave = getMaxIdlePerKey();
         if (this.minIdlePerKey > maxIdlePerKeySave) {
             return maxIdlePerKeySave;
         }
@@ -341,11 +341,11 @@ public class GenericKeyedObjectPool<K,T>
 
         // Get local copy of current config so it is consistent for entire
         // method execution
-        boolean blockWhenExhausted = getBlockWhenExhausted();
+        final boolean blockWhenExhausted = getBlockWhenExhausted();
 
         boolean create;
-        long waitTime = System.currentTimeMillis();
-        ObjectDeque<T> objectDeque = register(key);
+        final long waitTime = System.currentTimeMillis();
+        final ObjectDeque<T> objectDeque = register(key);
 
         try {
             while (p == null) {
@@ -392,15 +392,15 @@ public class GenericKeyedObjectPool<K,T>
                 if (p != null) {
                     try {
                         factory.activateObject(key, p);
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         try {
                             destroy(key, p, true);
-                        } catch (Exception e1) {
+                        } catch (final Exception e1) {
                             // Ignore - activation failure is more important
                         }
                         p = null;
                         if (create) {
-                            NoSuchElementException nsee = new NoSuchElementException(
+                            final NoSuchElementException nsee = new NoSuchElementException(
                                     "Unable to activate object");
                             nsee.initCause(e);
                             throw nsee;
@@ -411,7 +411,7 @@ public class GenericKeyedObjectPool<K,T>
                         Throwable validationThrowable = null;
                         try {
                             validate = factory.validateObject(key, p);
-                        } catch (Throwable t) {
+                        } catch (final Throwable t) {
                             PoolUtils.checkRethrow(t);
                             validationThrowable = t;
                         }
@@ -419,12 +419,12 @@ public class GenericKeyedObjectPool<K,T>
                             try {
                                 destroy(key, p, true);
                                 destroyedByBorrowValidationCount.incrementAndGet();
-                            } catch (Exception e) {
+                            } catch (final Exception e) {
                                 // Ignore - validation failure is more important
                             }
                             p = null;
                             if (create) {
-                                NoSuchElementException nsee = new NoSuchElementException(
+                                final NoSuchElementException nsee = new NoSuchElementException(
                                         "Unable to validate object");
                                 nsee.initCause(validationThrowable);
                                 throw nsee;
@@ -468,9 +468,9 @@ public class GenericKeyedObjectPool<K,T>
     @Override
     public void returnObject(K key, T obj) {
 
-        ObjectDeque<T> objectDeque = poolMap.get(key);
+        final ObjectDeque<T> objectDeque = poolMap.get(key);
 
-        PooledObject<T> p = objectDeque.getAllObjects().get(new IdentityWrapper<T>(obj));
+        final PooledObject<T> p = objectDeque.getAllObjects().get(new IdentityWrapper<T>(obj));
 
         if (p == null) {
             throw new IllegalStateException(
@@ -486,19 +486,19 @@ public class GenericKeyedObjectPool<K,T>
             p.markReturning(); // Keep from being marked abandoned (once GKOP does this)
         }
 
-        long activeTime = p.getActiveTimeMillis();
+        final long activeTime = p.getActiveTimeMillis();
 
         if (getTestOnReturn()) {
             if (!factory.validateObject(key, p)) {
                 try {
                     destroy(key, p, true);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
                 if (objectDeque.idleObjects.hasTakeWaiters()) {
                     try {
                         addObject(key);
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         swallowException(e);
                     }
                 }
@@ -509,17 +509,17 @@ public class GenericKeyedObjectPool<K,T>
 
         try {
             factory.passivateObject(key, p);
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             swallowException(e1);
             try {
                 destroy(key, p, true);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
             if (objectDeque.idleObjects.hasTakeWaiters()) {
                 try {
                     addObject(key);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
             }
@@ -532,14 +532,14 @@ public class GenericKeyedObjectPool<K,T>
                     "Object has already been returned to this pool");
         }
 
-        int maxIdle = getMaxIdlePerKey();
-        LinkedBlockingDeque<PooledObject<T>> idleObjects =
+        final int maxIdle = getMaxIdlePerKey();
+        final LinkedBlockingDeque<PooledObject<T>> idleObjects =
             objectDeque.getIdleObjects();
 
         if (isClosed() || maxIdle > -1 && maxIdle <= idleObjects.size()) {
             try {
                 destroy(key, p, true);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
         } else {
@@ -581,9 +581,9 @@ public class GenericKeyedObjectPool<K,T>
     @Override
     public void invalidateObject(K key, T obj) throws Exception {
 
-        ObjectDeque<T> objectDeque = poolMap.get(key);
+        final ObjectDeque<T> objectDeque = poolMap.get(key);
 
-        PooledObject<T> p = objectDeque.getAllObjects().get(new IdentityWrapper<T>(obj));
+        final PooledObject<T> p = objectDeque.getAllObjects().get(new IdentityWrapper<T>(obj));
         if (p == null) {
             throw new IllegalStateException(
                     "Object not currently part of this pool");
@@ -619,7 +619,7 @@ public class GenericKeyedObjectPool<K,T>
      */
     @Override
     public void clear() {
-        Iterator<K> iter = poolMap.keySet().iterator();
+        final Iterator<K> iter = poolMap.keySet().iterator();
 
         while (iter.hasNext()) {
             clear(iter.next());
@@ -638,10 +638,10 @@ public class GenericKeyedObjectPool<K,T>
     @Override
     public void clear(K key) {
 
-        ObjectDeque<T> objectDeque = register(key);
+        final ObjectDeque<T> objectDeque = register(key);
 
         try {
-            LinkedBlockingDeque<PooledObject<T>> idleObjects =
+            final LinkedBlockingDeque<PooledObject<T>> idleObjects =
                     objectDeque.getIdleObjects();
 
             PooledObject<T> p = idleObjects.poll();
@@ -649,7 +649,7 @@ public class GenericKeyedObjectPool<K,T>
             while (p != null) {
                 try {
                     destroy(key, p, true);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
                 p = idleObjects.poll();
@@ -668,7 +668,7 @@ public class GenericKeyedObjectPool<K,T>
 
     @Override
     public int getNumIdle() {
-        Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
+        final Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
         int result = 0;
 
         while (iter.hasNext()) {
@@ -728,7 +728,7 @@ public class GenericKeyedObjectPool<K,T>
             jmxUnregister();
 
             // Release any threads that were waiting for an object
-            Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
+            final Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
             while (iter.hasNext()) {
                 iter.next().getIdleObjects().interuptTakeWaiters();
             }
@@ -748,14 +748,14 @@ public class GenericKeyedObjectPool<K,T>
         // build sorted map of idle objects
         final Map<PooledObject<T>, K> map = new TreeMap<PooledObject<T>, K>();
 
-        for (K k : poolMap.keySet()) {
-            ObjectDeque<T> queue = poolMap.get(k);
+        for (final K k : poolMap.keySet()) {
+            final ObjectDeque<T> queue = poolMap.get(k);
             // Protect against possible NPE if key has been removed in another
             // thread. Not worth locking the keys while this loop completes.
             if (queue != null) {
                 final LinkedBlockingDeque<PooledObject<T>> idleObjects =
                     queue.getIdleObjects();
-                for (PooledObject<T> p : idleObjects) {
+                for (final PooledObject<T> p : idleObjects) {
                     // each item into the map using the PooledObject object as the
                     // key. It then gets sorted based on the idle time
                     map.put(p, k);
@@ -766,22 +766,22 @@ public class GenericKeyedObjectPool<K,T>
         // Now iterate created map and kill the first 15% plus one to account
         // for zero
         int itemsToRemove = ((int) (map.size() * 0.15)) + 1;
-        Iterator<Map.Entry<PooledObject<T>, K>> iter =
+        final Iterator<Map.Entry<PooledObject<T>, K>> iter =
             map.entrySet().iterator();
 
         while (iter.hasNext() && itemsToRemove > 0) {
-            Map.Entry<PooledObject<T>, K> entry = iter.next();
+            final Map.Entry<PooledObject<T>, K> entry = iter.next();
             // kind of backwards on naming.  In the map, each key is the
             // PooledObject because it has the ordering with the timestamp
             // value.  Each value that the key references is the key of the
             // list it belongs to.
-            K key = entry.getValue();
-            PooledObject<T> p = entry.getKey();
+            final K key = entry.getValue();
+            final PooledObject<T> p = entry.getKey();
             // Assume the destruction succeeds
             boolean destroyed = true;
             try {
                 destroyed = destroy(key, p, false);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
             if (destroyed) {
@@ -810,7 +810,7 @@ public class GenericKeyedObjectPool<K,T>
         int maxQueueLength = 0;
         LinkedBlockingDeque<PooledObject<T>> mostLoaded = null;
         K loadedKey = null;
-        for (K k : poolMap.keySet()) {
+        for (final K k : poolMap.keySet()) {
             final ObjectDeque<T> deque = poolMap.get(k);
             if (deque != null) {
                 final LinkedBlockingDeque<PooledObject<T>> pool = deque.getIdleObjects();
@@ -827,11 +827,11 @@ public class GenericKeyedObjectPool<K,T>
         if (mostLoaded != null) {
             register(loadedKey);
             try {
-                PooledObject<T> p = create(loadedKey);
+                final PooledObject<T> p = create(loadedKey);
                 if (p != null) {
                     addIdleObject(loadedKey, p);
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             } finally {
                 deregister(loadedKey);
@@ -847,7 +847,7 @@ public class GenericKeyedObjectPool<K,T>
      *         {@code false}
      */
     private boolean hasBorrowWaiters() {
-        for (K k : poolMap.keySet()) {
+        for (final K k : poolMap.keySet()) {
             final ObjectDeque<T> deque = poolMap.get(k);
             if (deque != null) {
                 final LinkedBlockingDeque<PooledObject<T>> pool =
@@ -877,22 +877,22 @@ public class GenericKeyedObjectPool<K,T>
         }
 
         PooledObject<T> underTest = null;
-        EvictionPolicy<T> evictionPolicy = getEvictionPolicy();
+        final EvictionPolicy<T> evictionPolicy = getEvictionPolicy();
 
         synchronized (evictionLock) {
-            EvictionConfig evictionConfig = new EvictionConfig(
+            final EvictionConfig evictionConfig = new EvictionConfig(
                     getMinEvictableIdleTimeMillis(),
                     getSoftMinEvictableIdleTimeMillis(),
                     getMinIdlePerKey());
 
-            boolean testWhileIdle = getTestWhileIdle();
+            final boolean testWhileIdle = getTestWhileIdle();
 
             for (int i = 0, m = getNumTests(); i < m; i++) {
                 if(evictionIterator == null || !evictionIterator.hasNext()) {
                     if (evictionKeyIterator == null ||
                             !evictionKeyIterator.hasNext()) {
-                        List<K> keyCopy = new ArrayList<K>();
-                        Lock readLock = keyLock.readLock();
+                        final List<K> keyCopy = new ArrayList<K>();
+                        final Lock readLock = keyLock.readLock();
                         readLock.lock();
                         try {
                             keyCopy.addAll(poolKeyList);
@@ -903,7 +903,7 @@ public class GenericKeyedObjectPool<K,T>
                     }
                     while (evictionKeyIterator.hasNext()) {
                         evictionKey = evictionKeyIterator.next();
-                        ObjectDeque<T> objectDeque = poolMap.get(evictionKey);
+                        final ObjectDeque<T> objectDeque = poolMap.get(evictionKey);
                         if (objectDeque == null) {
                             continue;
                         }
@@ -924,7 +924,7 @@ public class GenericKeyedObjectPool<K,T>
                 try {
                     underTest = evictionIterator.next();
                     idleObjects = evictionIterator.getIdleObjects();
-                } catch (NoSuchElementException nsee) {
+                } catch (final NoSuchElementException nsee) {
                     // Object was borrowed in another thread
                     // Don't count this as an eviction test so reduce i;
                     i--;
@@ -946,7 +946,7 @@ public class GenericKeyedObjectPool<K,T>
                 try {
                     evict = evictionPolicy.evict(evictionConfig, underTest,
                             poolMap.get(evictionKey).getIdleObjects().size());
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     // Slightly convoluted as SwallowedExceptionListener
                     // uses Exception rather than Throwable
                     PoolUtils.checkRethrow(t);
@@ -964,7 +964,7 @@ public class GenericKeyedObjectPool<K,T>
                         try {
                             factory.activateObject(evictionKey, underTest);
                             active = true;
-                        } catch (Exception e) {
+                        } catch (final Exception e) {
                             destroy(evictionKey, underTest, true);
                             destroyedByEvictorCount.incrementAndGet();
                         }
@@ -975,7 +975,7 @@ public class GenericKeyedObjectPool<K,T>
                             } else {
                                 try {
                                     factory.passivateObject(evictionKey, underTest);
-                                } catch (Exception e) {
+                                } catch (final Exception e) {
                                     destroy(evictionKey, underTest, true);
                                     destroyedByEvictorCount.incrementAndGet();
                                 }
@@ -1001,14 +1001,14 @@ public class GenericKeyedObjectPool<K,T>
      * @throws Exception If the objection creation fails
      */
     private PooledObject<T> create(K key) throws Exception {
-        int maxTotalPerKeySave = getMaxTotalPerKey(); // Per key
-        int maxTotal = getMaxTotal();   // All keys
+        final int maxTotalPerKeySave = getMaxTotalPerKey(); // Per key
+        final int maxTotal = getMaxTotal();   // All keys
 
         // Check against the overall limit
         boolean loop = true;
 
         while (loop) {
-            int newNumTotal = numTotal.incrementAndGet();
+            final int newNumTotal = numTotal.incrementAndGet();
             if (maxTotal > -1 && newNumTotal > maxTotal) {
                 numTotal.decrementAndGet();
                 if (getNumIdle() == 0) {
@@ -1020,8 +1020,8 @@ public class GenericKeyedObjectPool<K,T>
             }
         }
 
-        ObjectDeque<T> objectDeque = poolMap.get(key);
-        long newCreateCount = objectDeque.getCreateCount().incrementAndGet();
+        final ObjectDeque<T> objectDeque = poolMap.get(key);
+        final long newCreateCount = objectDeque.getCreateCount().incrementAndGet();
 
         // Check against the per key limit
         if (maxTotalPerKeySave > -1 && newCreateCount > maxTotalPerKeySave ||
@@ -1035,7 +1035,7 @@ public class GenericKeyedObjectPool<K,T>
         PooledObject<T> p = null;
         try {
             p = factory.makeObject(key);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             numTotal.decrementAndGet();
             objectDeque.getCreateCount().decrementAndGet();
             throw e;
@@ -1059,10 +1059,10 @@ public class GenericKeyedObjectPool<K,T>
     private boolean destroy(K key, PooledObject<T> toDestroy, boolean always)
             throws Exception {
 
-        ObjectDeque<T> objectDeque = register(key);
+        final ObjectDeque<T> objectDeque = register(key);
 
         try {
-            boolean isIdle = objectDeque.getIdleObjects().remove(toDestroy);
+            final boolean isIdle = objectDeque.getIdleObjects().remove(toDestroy);
 
             if (isIdle || always) {
                 objectDeque.getAllObjects().remove(new IdentityWrapper<T>(toDestroy.getObject()));
@@ -1138,10 +1138,10 @@ public class GenericKeyedObjectPool<K,T>
         ObjectDeque<T> objectDeque;
 
         objectDeque = poolMap.get(k);
-        long numInterested = objectDeque.getNumInterested().decrementAndGet();
+        final long numInterested = objectDeque.getNumInterested().decrementAndGet();
         if (numInterested == 0 && objectDeque.getCreateCount().get() == 0) {
             // Potential to remove key
-            Lock writeLock = keyLock.writeLock();
+            final Lock writeLock = keyLock.writeLock();
             writeLock.lock();
             try {
                 if (objectDeque.getCreateCount().get() == 0 &&
@@ -1160,12 +1160,12 @@ public class GenericKeyedObjectPool<K,T>
 
     @Override
     void ensureMinIdle() throws Exception {
-        int minIdlePerKeySave = getMinIdlePerKey();
+        final int minIdlePerKeySave = getMinIdlePerKey();
         if (minIdlePerKeySave < 1) {
             return;
         }
 
-        for (K k : poolMap.keySet()) {
+        for (final K k : poolMap.keySet()) {
             ensureMinIdle(k);
         }
     }
@@ -1180,7 +1180,7 @@ public class GenericKeyedObjectPool<K,T>
      */
     private void ensureMinIdle(K key) throws Exception {
         // Calculate current pool objects
-        ObjectDeque<T> objectDeque = poolMap.get(key);
+        final ObjectDeque<T> objectDeque = poolMap.get(key);
 
         // objectDeque == null is OK here. It is handled correctly by both
         // methods called below.
@@ -1190,7 +1190,7 @@ public class GenericKeyedObjectPool<K,T>
         // as a loop limit and a second time inside the loop
         // to stop when another thread already returned the
         // needed objects
-        int deficit = calculateDeficit(objectDeque);
+        final int deficit = calculateDeficit(objectDeque);
 
         for (int i = 0; i < deficit && calculateDeficit(objectDeque) > 0; i++) {
             addObject(key);
@@ -1213,7 +1213,7 @@ public class GenericKeyedObjectPool<K,T>
         assertOpen();
         register(key);
         try {
-            PooledObject<T> p = create(key);
+            final PooledObject<T> p = create(key);
             addIdleObject(key, p);
         } finally {
             deregister(key);
@@ -1232,7 +1232,7 @@ public class GenericKeyedObjectPool<K,T>
 
         if (p != null) {
             factory.passivateObject(key, p);
-            LinkedBlockingDeque<PooledObject<T>> idleObjects =
+            final LinkedBlockingDeque<PooledObject<T>> idleObjects =
                     poolMap.get(key).getIdleObjects();
             if (getLifo()) {
                 idleObjects.addFirst(p);
@@ -1251,7 +1251,7 @@ public class GenericKeyedObjectPool<K,T>
      * @throws Exception If the associated factory throws an exception
      */
     public void preparePool(K key) throws Exception {
-        int minIdlePerKeySave = getMinIdlePerKey();
+        final int minIdlePerKeySave = getMinIdlePerKey();
         if (minIdlePerKeySave < 1) {
             return;
         }
@@ -1265,8 +1265,8 @@ public class GenericKeyedObjectPool<K,T>
      * @return The number of objects to test for validity
      */
     private int getNumTests() {
-        int totalIdle = getNumIdle();
-        int numTests = getNumTestsPerEvictionRun();
+        final int totalIdle = getNumIdle();
+        final int numTests = getNumTestsPerEvictionRun();
         if (numTests >= 0) {
             return Math.min(numTests, totalIdle);
         }
@@ -1289,8 +1289,8 @@ public class GenericKeyedObjectPool<K,T>
         }
 
         // Used more than once so keep a local copy so the value is consistent
-        int maxTotal = getMaxTotal();
-        int maxTotalPerKeySave = getMaxTotalPerKey();
+        final int maxTotal = getMaxTotal();
+        final int maxTotalPerKeySave = getMaxTotalPerKey();
 
         int objectDefecit = 0;
 
@@ -1298,14 +1298,14 @@ public class GenericKeyedObjectPool<K,T>
         // the number of pooled objects < maxTotalPerKey();
         objectDefecit = getMinIdlePerKey() - objectDeque.getIdleObjects().size();
         if (maxTotalPerKeySave > 0) {
-            int growLimit = Math.max(0,
+            final int growLimit = Math.max(0,
                     maxTotalPerKeySave - objectDeque.getIdleObjects().size());
             objectDefecit = Math.min(objectDefecit, growLimit);
         }
 
         // Take the maxTotal limit into account
         if (maxTotal > 0) {
-            int growLimit = Math.max(0, maxTotal - getNumActive() - getNumIdle());
+            final int growLimit = Math.max(0, maxTotal - getNumActive() - getNumIdle());
             objectDefecit = Math.min(objectDefecit, growLimit);
         }
 
@@ -1317,14 +1317,14 @@ public class GenericKeyedObjectPool<K,T>
 
     @Override
     public Map<String,Integer> getNumActivePerKey() {
-        HashMap<String,Integer> result = new HashMap<String,Integer>();
+        final HashMap<String,Integer> result = new HashMap<String,Integer>();
 
-        Iterator<Entry<K,ObjectDeque<T>>> iter = poolMap.entrySet().iterator();
+        final Iterator<Entry<K,ObjectDeque<T>>> iter = poolMap.entrySet().iterator();
         while (iter.hasNext()) {
-            Entry<K,ObjectDeque<T>> entry = iter.next();
+            final Entry<K,ObjectDeque<T>> entry = iter.next();
             if (entry != null) {
-                K key = entry.getKey();
-                ObjectDeque<T> objectDequeue = entry.getValue();
+                final K key = entry.getKey();
+                final ObjectDeque<T> objectDequeue = entry.getValue();
                 if (key != null && objectDequeue != null) {
                     result.put(key.toString(), Integer.valueOf(
                             objectDequeue.getAllObjects().size() -
@@ -1348,7 +1348,7 @@ public class GenericKeyedObjectPool<K,T>
         int result = 0;
 
         if (getBlockWhenExhausted()) {
-            Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
+            final Iterator<ObjectDeque<T>> iter = poolMap.values().iterator();
 
             while (iter.hasNext()) {
                 // Assume no overflow
@@ -1369,10 +1369,10 @@ public class GenericKeyedObjectPool<K,T>
      */
     @Override
     public Map<String,Integer> getNumWaitersByKey() {
-        Map<String,Integer> result = new HashMap<String,Integer>();
+        final Map<String,Integer> result = new HashMap<String,Integer>();
 
-        for (K key : poolMap.keySet()) {
-            ObjectDeque<T> queue = poolMap.get(key);
+        for (final K key : poolMap.keySet()) {
+            final ObjectDeque<T> queue = poolMap.get(key);
             if (queue != null) {
                 if (getBlockWhenExhausted()) {
                     result.put(key.toString(), Integer.valueOf(
@@ -1398,16 +1398,16 @@ public class GenericKeyedObjectPool<K,T>
      */
     @Override
     public Map<String,List<DefaultPooledObjectInfo>> listAllObjects() {
-        Map<String,List<DefaultPooledObjectInfo>> result =
+        final Map<String,List<DefaultPooledObjectInfo>> result =
                 new HashMap<String,List<DefaultPooledObjectInfo>>();
 
-        for (K key : poolMap.keySet()) {
-            ObjectDeque<T> queue = poolMap.get(key);
+        for (final K key : poolMap.keySet()) {
+            final ObjectDeque<T> queue = poolMap.get(key);
             if (queue != null) {
-                List<DefaultPooledObjectInfo> list =
+                final List<DefaultPooledObjectInfo> list =
                         new ArrayList<DefaultPooledObjectInfo>();
                 result.put(key.toString(), list);
-                for (PooledObject<T> p : queue.getAllObjects().values()) {
+                for (final PooledObject<T> p : queue.getAllObjects().values()) {
                     list.add(new DefaultPooledObjectInfo(p));
                 }
             }
@@ -1494,7 +1494,7 @@ public class GenericKeyedObjectPool<K,T>
 
         @Override
         public String toString() {
-            StringBuilder builder = new StringBuilder();
+            final StringBuilder builder = new StringBuilder();
             builder.append("ObjectDeque [idleObjects=");
             builder.append(idleObjects);
             builder.append(", createCount=");

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java Mon Feb  8 21:45:12 2016
@@ -177,7 +177,7 @@ public class GenericKeyedObjectPoolConfi
     public GenericKeyedObjectPoolConfig clone() {
         try {
             return (GenericKeyedObjectPoolConfig) super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new AssertionError(); // Can't happen
         }
     }

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java Mon Feb  8 21:45:12 2016
@@ -216,7 +216,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public int getMinIdle() {
-        int maxIdleSave = getMaxIdle();
+        final int maxIdleSave = getMaxIdle();
         if (this.minIdle > maxIdleSave) {
             return maxIdleSave;
         }
@@ -244,7 +244,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public boolean getLogAbandoned() {
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         return ac != null && ac.getLogAbandoned();
     }
 
@@ -259,7 +259,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public boolean getRemoveAbandonedOnBorrow() {
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         return ac != null && ac.getRemoveAbandonedOnBorrow();
     }
 
@@ -273,7 +273,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public boolean getRemoveAbandonedOnMaintenance() {
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         return ac != null && ac.getRemoveAbandonedOnMaintenance();
     }
 
@@ -288,7 +288,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public int getRemoveAbandonedTimeout() {
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         return ac != null ? ac.getRemoveAbandonedTimeout() : Integer.MAX_VALUE;
     }
 
@@ -410,7 +410,7 @@ public class GenericObjectPool<T> extend
     public T borrowObject(long borrowMaxWaitMillis) throws Exception {
         assertOpen();
 
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         if (ac != null && ac.getRemoveAbandonedOnBorrow() &&
                 (getNumIdle() < 2) &&
                 (getNumActive() > getMaxTotal() - 3) ) {
@@ -421,10 +421,10 @@ public class GenericObjectPool<T> extend
 
         // Get local copy of current config so it is consistent for entire
         // method execution
-        boolean blockWhenExhausted = getBlockWhenExhausted();
+        final boolean blockWhenExhausted = getBlockWhenExhausted();
 
         boolean create;
-        long waitTime = System.currentTimeMillis();
+        final long waitTime = System.currentTimeMillis();
 
         while (p == null) {
             create = false;
@@ -470,15 +470,15 @@ public class GenericObjectPool<T> extend
             if (p != null) {
                 try {
                     factory.activateObject(p);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     try {
                         destroy(p);
-                    } catch (Exception e1) {
+                    } catch (final Exception e1) {
                         // Ignore - activation failure is more important
                     }
                     p = null;
                     if (create) {
-                        NoSuchElementException nsee = new NoSuchElementException(
+                        final NoSuchElementException nsee = new NoSuchElementException(
                                 "Unable to activate object");
                         nsee.initCause(e);
                         throw nsee;
@@ -489,7 +489,7 @@ public class GenericObjectPool<T> extend
                     Throwable validationThrowable = null;
                     try {
                         validate = factory.validateObject(p);
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         PoolUtils.checkRethrow(t);
                         validationThrowable = t;
                     }
@@ -497,12 +497,12 @@ public class GenericObjectPool<T> extend
                         try {
                             destroy(p);
                             destroyedByBorrowValidationCount.incrementAndGet();
-                        } catch (Exception e) {
+                        } catch (final Exception e) {
                             // Ignore - validation failure is more important
                         }
                         p = null;
                         if (create) {
-                            NoSuchElementException nsee = new NoSuchElementException(
+                            final NoSuchElementException nsee = new NoSuchElementException(
                                     "Unable to validate object");
                             nsee.initCause(validationThrowable);
                             throw nsee;
@@ -533,7 +533,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public void returnObject(T obj) {
-        PooledObject<T> p = allObjects.get(new IdentityWrapper<T>(obj));
+        final PooledObject<T> p = allObjects.get(new IdentityWrapper<T>(obj));
 
         if (p == null) {
             if (!isAbandonedConfig()) {
@@ -552,18 +552,18 @@ public class GenericObjectPool<T> extend
             p.markReturning(); // Keep from being marked abandoned
         }
 
-        long activeTime = p.getActiveTimeMillis();
+        final long activeTime = p.getActiveTimeMillis();
 
         if (getTestOnReturn()) {
             if (!factory.validateObject(p)) {
                 try {
                     destroy(p);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
                 try {
                     ensureIdle(1, false);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     swallowException(e);
                 }
                 updateStatsReturn(activeTime);
@@ -573,16 +573,16 @@ public class GenericObjectPool<T> extend
 
         try {
             factory.passivateObject(p);
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             swallowException(e1);
             try {
                 destroy(p);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
             try {
                 ensureIdle(1, false);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
             updateStatsReturn(activeTime);
@@ -594,11 +594,11 @@ public class GenericObjectPool<T> extend
                     "Object has already been returned to this pool or is invalid");
         }
 
-        int maxIdleSave = getMaxIdle();
+        final int maxIdleSave = getMaxIdle();
         if (isClosed() || maxIdleSave > -1 && maxIdleSave <= idleObjects.size()) {
             try {
                 destroy(p);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
         } else {
@@ -629,7 +629,7 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public void invalidateObject(T obj) throws Exception {
-        PooledObject<T> p = allObjects.get(new IdentityWrapper<T>(obj));
+        final PooledObject<T> p = allObjects.get(new IdentityWrapper<T>(obj));
         if (p == null) {
             if (isAbandonedConfig()) {
                 return;
@@ -669,7 +669,7 @@ public class GenericObjectPool<T> extend
         while (p != null) {
             try {
                 destroy(p);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 swallowException(e);
             }
             p = idleObjects.poll();
@@ -733,15 +733,15 @@ public class GenericObjectPool<T> extend
         if (idleObjects.size() > 0) {
 
             PooledObject<T> underTest = null;
-            EvictionPolicy<T> evictionPolicy = getEvictionPolicy();
+            final EvictionPolicy<T> evictionPolicy = getEvictionPolicy();
 
             synchronized (evictionLock) {
-                EvictionConfig evictionConfig = new EvictionConfig(
+                final EvictionConfig evictionConfig = new EvictionConfig(
                         getMinEvictableIdleTimeMillis(),
                         getSoftMinEvictableIdleTimeMillis(),
                         getMinIdle());
 
-                boolean testWhileIdle = getTestWhileIdle();
+                final boolean testWhileIdle = getTestWhileIdle();
 
                 for (int i = 0, m = getNumTests(); i < m; i++) {
                     if (evictionIterator == null || !evictionIterator.hasNext()) {
@@ -754,7 +754,7 @@ public class GenericObjectPool<T> extend
 
                     try {
                         underTest = evictionIterator.next();
-                    } catch (NoSuchElementException nsee) {
+                    } catch (final NoSuchElementException nsee) {
                         // Object was borrowed in another thread
                         // Don't count this as an eviction test so reduce i;
                         i--;
@@ -776,7 +776,7 @@ public class GenericObjectPool<T> extend
                     try {
                         evict = evictionPolicy.evict(evictionConfig, underTest,
                                 idleObjects.size());
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         // Slightly convoluted as SwallowedExceptionListener
                         // uses Exception rather than Throwable
                         PoolUtils.checkRethrow(t);
@@ -794,7 +794,7 @@ public class GenericObjectPool<T> extend
                             try {
                                 factory.activateObject(underTest);
                                 active = true;
-                            } catch (Exception e) {
+                            } catch (final Exception e) {
                                 destroy(underTest);
                                 destroyedByEvictorCount.incrementAndGet();
                             }
@@ -805,7 +805,7 @@ public class GenericObjectPool<T> extend
                                 } else {
                                     try {
                                         factory.passivateObject(underTest);
-                                    } catch (Exception e) {
+                                    } catch (final Exception e) {
                                         destroy(underTest);
                                         destroyedByEvictorCount.incrementAndGet();
                                     }
@@ -820,7 +820,7 @@ public class GenericObjectPool<T> extend
                 }
             }
         }
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         if (ac != null && ac.getRemoveAbandonedOnMaintenance()) {
             removeAbandoned(ac);
         }
@@ -851,8 +851,8 @@ public class GenericObjectPool<T> extend
      * @throws Exception if the object factory's {@code makeObject} fails
      */
     private PooledObject<T> create() throws Exception {
-        int localMaxTotal = getMaxTotal();
-        long newCreateCount = createCount.incrementAndGet();
+        final int localMaxTotal = getMaxTotal();
+        final long newCreateCount = createCount.incrementAndGet();
         if (localMaxTotal > -1 && newCreateCount > localMaxTotal ||
                 newCreateCount > Integer.MAX_VALUE) {
             createCount.decrementAndGet();
@@ -862,12 +862,12 @@ public class GenericObjectPool<T> extend
         final PooledObject<T> p;
         try {
             p = factory.makeObject();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             createCount.decrementAndGet();
             throw e;
         }
 
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         if (ac != null && ac.getLogAbandoned()) {
             p.setLogAbandoned(true);
         }
@@ -920,7 +920,7 @@ public class GenericObjectPool<T> extend
         }
 
         while (idleObjects.size() < idleCount) {
-            PooledObject<T> p = create();
+            final PooledObject<T> p = create();
             if (p == null) {
                 // Can't create objects, no reason to think another call to
                 // create will work. Give up.
@@ -954,7 +954,7 @@ public class GenericObjectPool<T> extend
             throw new IllegalStateException(
                     "Cannot add objects without a factory.");
         }
-        PooledObject<T> p = create();
+        final PooledObject<T> p = create();
         addIdleObject(p);
     }
 
@@ -985,7 +985,7 @@ public class GenericObjectPool<T> extend
      * @return The number of objects to test for validity
      */
     private int getNumTests() {
-        int numTestsPerEvictionRun = getNumTestsPerEvictionRun();
+        final int numTestsPerEvictionRun = getNumTestsPerEvictionRun();
         if (numTestsPerEvictionRun >= 0) {
             return Math.min(numTestsPerEvictionRun, idleObjects.size());
         }
@@ -1004,10 +1004,10 @@ public class GenericObjectPool<T> extend
         final long now = System.currentTimeMillis();
         final long timeout =
                 now - (ac.getRemoveAbandonedTimeout() * 1000L);
-        ArrayList<PooledObject<T>> remove = new ArrayList<PooledObject<T>>();
-        Iterator<PooledObject<T>> it = allObjects.values().iterator();
+        final ArrayList<PooledObject<T>> remove = new ArrayList<PooledObject<T>>();
+        final Iterator<PooledObject<T>> it = allObjects.values().iterator();
         while (it.hasNext()) {
-            PooledObject<T> pooledObject = it.next();
+            final PooledObject<T> pooledObject = it.next();
             synchronized (pooledObject) {
                 if (pooledObject.getState() == PooledObjectState.ALLOCATED &&
                         pooledObject.getLastUsedTime() <= timeout) {
@@ -1018,15 +1018,15 @@ public class GenericObjectPool<T> extend
         }
 
         // Now remove the abandoned objects
-        Iterator<PooledObject<T>> itr = remove.iterator();
+        final Iterator<PooledObject<T>> itr = remove.iterator();
         while (itr.hasNext()) {
-            PooledObject<T> pooledObject = itr.next();
+            final PooledObject<T> pooledObject = itr.next();
             if (ac.getLogAbandoned()) {
                 pooledObject.printStackTrace(ac.getLogWriter());
             }
             try {
                 invalidateObject(pooledObject.getObject());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -1037,9 +1037,9 @@ public class GenericObjectPool<T> extend
 
     @Override
     public void use(T pooledObject) {
-        AbandonedConfig ac = this.abandonedConfig;
+        final AbandonedConfig ac = this.abandonedConfig;
         if (ac != null && ac.getUseUsageTracking()) {
-            PooledObject<T> wrapper = allObjects.get(new IdentityWrapper<T>(pooledObject));
+            final PooledObject<T> wrapper = allObjects.get(new IdentityWrapper<T>(pooledObject));
             wrapper.use();
         }
     }
@@ -1075,10 +1075,10 @@ public class GenericObjectPool<T> extend
     public String getFactoryType() {
         // Not thread safe. Accept that there may be multiple evaluations.
         if (factoryType == null) {
-            StringBuilder result = new StringBuilder();
+            final StringBuilder result = new StringBuilder();
             result.append(factory.getClass().getName());
             result.append('<');
-            Class<?> pooledObjectType =
+            final Class<?> pooledObjectType =
                     PoolImplUtils.getFactoryType(factory.getClass());
             result.append(pooledObjectType.getName());
             result.append('>');
@@ -1100,9 +1100,9 @@ public class GenericObjectPool<T> extend
      */
     @Override
     public Set<DefaultPooledObjectInfo> listAllObjects() {
-        Set<DefaultPooledObjectInfo> result =
+        final Set<DefaultPooledObjectInfo> result =
                 new HashSet<DefaultPooledObjectInfo>(allObjects.size());
-        for (PooledObject<T> p : allObjects.values()) {
+        for (final PooledObject<T> p : allObjects.values()) {
             result.add(new DefaultPooledObjectInfo(p));
         }
         return result;

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java Mon Feb  8 21:45:12 2016
@@ -139,7 +139,7 @@ public class GenericObjectPoolConfig ext
     public GenericObjectPoolConfig clone() {
         try {
             return (GenericObjectPoolConfig) super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new AssertionError(); // Can't happen
         }
     }

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/InterruptibleReentrantLock.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/InterruptibleReentrantLock.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/InterruptibleReentrantLock.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/InterruptibleReentrantLock.java Mon Feb  8 21:45:12 2016
@@ -49,8 +49,8 @@ class InterruptibleReentrantLock extends
      * @param condition the condition on which the threads are waiting.
      */
     public void interruptWaiters(Condition condition) {
-        Collection<Thread> threads = getWaitingThreads(condition);
-        for (Thread thread : threads) {
+        final Collection<Thread> threads = getWaitingThreads(condition);
+        for (final Thread thread : threads) {
             thread.interrupt();
         }
     }

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java?rev=1729267&r1=1729266&r2=1729267&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java Mon Feb  8 21:45:12 2016
@@ -216,7 +216,7 @@ class LinkedBlockingDeque<E> extends Abs
         this(Integer.MAX_VALUE);
         lock.lock(); // Never contended, but necessary for visibility
         try {
-            for (E e : c) {
+            for (final E e : c) {
                 if (e == null) {
                     throw new NullPointerException();
                 }
@@ -244,8 +244,8 @@ class LinkedBlockingDeque<E> extends Abs
         if (count >= capacity) {
             return false;
         }
-        Node<E> f = first;
-        Node<E> x = new Node<E>(e, null, f);
+        final Node<E> f = first;
+        final Node<E> x = new Node<E>(e, null, f);
         first = x;
         if (last == null) {
             last = x;
@@ -269,8 +269,8 @@ class LinkedBlockingDeque<E> extends Abs
         if (count >= capacity) {
             return false;
         }
-        Node<E> l = last;
-        Node<E> x = new Node<E>(e, l, null);
+        final Node<E> l = last;
+        final Node<E> x = new Node<E>(e, l, null);
         last = x;
         if (first == null) {
             first = x;
@@ -289,12 +289,12 @@ class LinkedBlockingDeque<E> extends Abs
      */
     private E unlinkFirst() {
         // assert lock.isHeldByCurrentThread();
-        Node<E> f = first;
+        final Node<E> f = first;
         if (f == null) {
             return null;
         }
-        Node<E> n = f.next;
-        E item = f.item;
+        final Node<E> n = f.next;
+        final E item = f.item;
         f.item = null;
         f.next = f; // help GC
         first = n;
@@ -315,12 +315,12 @@ class LinkedBlockingDeque<E> extends Abs
      */
     private E unlinkLast() {
         // assert lock.isHeldByCurrentThread();
-        Node<E> l = last;
+        final Node<E> l = last;
         if (l == null) {
             return null;
         }
-        Node<E> p = l.prev;
-        E item = l.item;
+        final Node<E> p = l.prev;
+        final E item = l.item;
         l.item = null;
         l.prev = l; // help GC
         last = p;
@@ -341,8 +341,8 @@ class LinkedBlockingDeque<E> extends Abs
      */
     private void unlink(Node<E> x) {
         // assert lock.isHeldByCurrentThread();
-        Node<E> p = x.prev;
-        Node<E> n = x.next;
+        final Node<E> p = x.prev;
+        final Node<E> n = x.next;
         if (p == null) {
             unlinkFirst();
         } else if (n == null) {
@@ -533,7 +533,7 @@ class LinkedBlockingDeque<E> extends Abs
      */
     @Override
     public E removeFirst() {
-        E x = pollFirst();
+        final E x = pollFirst();
         if (x == null) {
             throw new NoSuchElementException();
         }
@@ -545,7 +545,7 @@ class LinkedBlockingDeque<E> extends Abs
      */
     @Override
     public E removeLast() {
-        E x = pollLast();
+        final E x = pollLast();
         if (x == null) {
             throw new NoSuchElementException();
         }
@@ -673,7 +673,7 @@ class LinkedBlockingDeque<E> extends Abs
      */
     @Override
     public E getFirst() {
-        E x = peekFirst();
+        final E x = peekFirst();
         if (x == null) {
             throw new NoSuchElementException();
         }
@@ -685,7 +685,7 @@ class LinkedBlockingDeque<E> extends Abs
      */
     @Override
     public E getLast() {
-        E x = peekLast();
+        final E x = peekLast();
         if (x == null) {
             throw new NoSuchElementException();
         }
@@ -941,7 +941,7 @@ class LinkedBlockingDeque<E> extends Abs
         }
         lock.lock();
         try {
-            int n = Math.min(maxElements, count);
+            final int n = Math.min(maxElements, count);
             for (int i = 0; i < n; i++) {
                 c.add(first.item);   // In this order, in case add() throws.
                 unlinkFirst();
@@ -1090,7 +1090,7 @@ class LinkedBlockingDeque<E> extends Abs
     public Object[] toArray() {
         lock.lock();
         try {
-            Object[] a = new Object[count];
+            final Object[] a = new Object[count];
             int k = 0;
             for (Node<E> p = first; p != null; p = p.next) {
                 a[k++] = p.item;
@@ -1146,7 +1146,7 @@ class LinkedBlockingDeque<E> extends Abs
         try {
             for (Node<E> f = first; f != null; ) {
                 f.item = null;
-                Node<E> n = f.next;
+                final Node<E> n = f.next;
                 f.prev = null;
                 f.next = null;
                 f = n;
@@ -1249,7 +1249,7 @@ class LinkedBlockingDeque<E> extends Abs
             // Chains of deleted nodes ending in null or self-links
             // are possible if multiple interior nodes are removed.
             for (;;) {
-                Node<E> s = nextNode(n);
+                final Node<E> s = nextNode(n);
                 if (s == null)
                     return null;
                 else if (s.item != null)
@@ -1286,14 +1286,14 @@ class LinkedBlockingDeque<E> extends Abs
                 throw new NoSuchElementException();
             }
             lastRet = next;
-            E x = nextItem;
+            final E x = nextItem;
             advance();
             return x;
         }
 
         @Override
         public void remove() {
-            Node<E> n = lastRet;
+            final Node<E> n = lastRet;
             if (n == null) {
                 throw new IllegalStateException();
             }
@@ -1363,6 +1363,7 @@ class LinkedBlockingDeque<E> extends Abs
         // Read in all elements and place in queue
         for (;;) {
             @SuppressWarnings("unchecked")
+            final
             E item = (E)s.readObject();
             if (item == null) {
                 break;



Mime
View raw message