You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/01/22 13:52:55 UTC

svn commit: r1436884 - in /commons/proper/pool/branches/POOL_1_X/src: java/org/apache/commons/pool/impl/ test/org/apache/commons/pool/ test/org/apache/commons/pool/impl/

Author: ggregory
Date: Tue Jan 22 12:52:55 2013
New Revision: 1436884

URL: http://svn.apache.org/viewvc?rev=1436884&view=rev
Log:
Add final modifier to private fields.

Modified:
    commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
    commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java
    commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
    commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolClassLoaders.java
    commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
    commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java

Modified: commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java Tue Jan 22 12:52:55 2013
@@ -2775,6 +2775,6 @@ public class GenericKeyedObjectPool<K, V
      * that objects can be allocated in the order in which the threads requested
      * them.
      */
-    private LinkedList<Latch<K, V>> _allocationQueue = new LinkedList<Latch<K, V>>();
+    private final LinkedList<Latch<K, V>> _allocationQueue = new LinkedList<Latch<K, V>>();
 
 }

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java Tue Jan 22 12:52:55 2013
@@ -58,7 +58,7 @@ KeyedPoolableObjectFactory<K, Waiter> {
     private long activeCount = 0;
     
     /** Count of (makes - destroys) per key since last reset */
-    private Map<K, Integer> activeCounts = new HashMap<K, Integer>();
+    private final Map<K, Integer> activeCounts = new HashMap<K, Integer>();
     
     /** Maximum of (makes - destroys) - if exceeded IllegalStateException */
     private final long maxActive;  // GKOP 1.x calls this maxTotal

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java Tue Jan 22 12:52:55 2013
@@ -1223,7 +1223,7 @@ public class TestGenericObjectPool exten
     }
 
     private class ConcurrentBorrowAndEvictThread extends Thread {
-        private boolean borrow;
+        private final boolean borrow;
         public String obj;
         
         public ConcurrentBorrowAndEvictThread(boolean borrow) {

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolClassLoaders.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolClassLoaders.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolClassLoaders.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolClassLoaders.java Tue Jan 22 12:52:55 2013
@@ -72,7 +72,7 @@ public class TestGenericObjectPoolClassL
 
 	private class CustomClassLoaderObjectFactory extends
 			BasePoolableObjectFactory<URL> {
-		private int n;
+		private final int n;
 
 		CustomClassLoaderObjectFactory(int n) {
 			this.n = n;
@@ -91,7 +91,7 @@ public class TestGenericObjectPoolClassL
 	}
 
 	private static class CustomClassLoader extends URLClassLoader {
-		private int n;
+		private final int n;
 
 		CustomClassLoader(int n) {
 			super(new URL[] { BASE_URL });

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java Tue Jan 22 12:52:55 2013
@@ -247,7 +247,7 @@ public class TestSoftRefOutOfMemory exte
     }
 
     public static class LargePoolableObjectFactory implements PoolableObjectFactory<String> {
-        private String buffer;
+        private final String buffer;
         private int counter = 0;
 
         public LargePoolableObjectFactory(int size) {

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java?rev=1436884&r1=1436883&r2=1436884&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java Tue Jan 22 12:52:55 2013
@@ -519,7 +519,7 @@ public class TestStackObjectPool extends
      * tracks object destruction.
      */
     static class SelectiveFactory implements PoolableObjectFactory<Integer> {
-        private List<Integer> destroyed = new ArrayList<Integer>();
+        private final List<Integer> destroyed = new ArrayList<Integer>();
         private int counter = 0;
         private boolean validateSelectively = false;  // true <-> validate returns false for even Integers
         private boolean passivateSelectively = false; // true <-> passivate throws RTE if Integer = 0 mod 3
@@ -606,8 +606,8 @@ public class TestStackObjectPool extends
     }
     
     static class IntegerFactoryException extends RuntimeException {
-        private String type;
-        private int value;
+        private final String type;
+        private final int value;
         public IntegerFactoryException(String type, int value) {
             super(type + " failed. Value: " + value);
             this.type = type;