Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48399
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 20 Dec 2009 03:46:02 +0000 (03:46 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 20 Dec 2009 03:46:02 +0000 (03:46 +0000)
Make locks final
Patch by sebb

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@892558 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/DeltaSession.java
java/org/apache/catalina/tribes/group/interceptors/OrderInterceptor.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java

index dfa726e..fd70a44 100644 (file)
@@ -92,7 +92,7 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
     private transient long lastTimeReplicated = System.currentTimeMillis();
 
 
-    protected Lock diffLock = new ReentrantReadWriteLock().writeLock();
+    protected final Lock diffLock = new ReentrantReadWriteLock().writeLock();
 
     private long version;
 
index 04d7e46..219b534 100644 (file)
@@ -61,8 +61,8 @@ public class OrderInterceptor extends ChannelInterceptorBase {
     private boolean forwardExpired = true;
     private int maxQueue = Integer.MAX_VALUE;
     
-    ReentrantReadWriteLock inLock = new ReentrantReadWriteLock(true);
-    ReentrantReadWriteLock outLock= new ReentrantReadWriteLock(true);
+    final ReentrantReadWriteLock inLock = new ReentrantReadWriteLock(true);
+    final ReentrantReadWriteLock outLock= new ReentrantReadWriteLock(true);
 
     @Override
     public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
index 7d37eaa..f5fd28e 100644 (file)
@@ -65,7 +65,7 @@ public class MultiLockFairBlockingQueue<E> implements BlockingQueue<E> {
      * per-thread-locks for the waiting phase we have 
      * a phase one lock during the contention period.
      */
-    final ReentrantLock[] locks = new ReentrantLock[LOCK_COUNT];
+    private final ReentrantLock[] locks = new ReentrantLock[LOCK_COUNT];
 
     /**
      * All the objects in the pool are stored in a simple linked list