tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366727 - in /tomcat/trunk/java/org/apache/catalina/tribes/group: GroupChannel.java RpcChannel.java
Date Sat, 28 Jul 2012 18:33:19 GMT
Author: markt
Date: Sat Jul 28 18:33:19 2012
New Revision: 1366727

URL: http://svn.apache.org/viewvc?rev=1366727&view=rev
Log:
Partial code clean-up for o.a.catalina.tribes
 - Add final prompted by UCDetector
 - Java 7 use of <>

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
    tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1366727&r1=1366726&r2=1366727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Sat Jul 28 18:33:19
2012
@@ -80,7 +80,7 @@ public class GroupChannel extends Channe
      * - ChannelSender <br>
      * - ChannelReceiver<br>
      */
-    protected ChannelCoordinator coordinator = new ChannelCoordinator();
+    protected final ChannelCoordinator coordinator = new ChannelCoordinator();
 
     /**
      * The first interceptor in the interceptor stack.
@@ -92,12 +92,12 @@ public class GroupChannel extends Channe
     /**
      * A list of membership listeners that subscribe to membership announcements
      */
-    protected ArrayList<Object> membershipListeners = new ArrayList<Object>();
+    protected final ArrayList<Object> membershipListeners = new ArrayList<>();
 
     /**
      * A list of channel listeners that subscribe to incoming messages
      */
-    protected ArrayList<Object> channelListeners = new ArrayList<Object>();
+    protected final ArrayList<Object> channelListeners = new ArrayList<>();
 
     /**
      * If set to true, the GroupChannel will check to make sure that
@@ -622,7 +622,7 @@ public class GroupChannel extends Channe
      * @version 1.0
      */
     public static class InterceptorIterator implements Iterator<ChannelInterceptor>
{
-        private ChannelInterceptor end;
+        private final ChannelInterceptor end;
         private ChannelInterceptor start;
         public InterceptorIterator(ChannelInterceptor start, ChannelInterceptor end) {
             this.end = end;
@@ -667,8 +667,8 @@ public class GroupChannel extends Channe
         }
 
         protected volatile boolean doRun = true;
-        protected GroupChannel channel;
-        protected long sleepTime;
+        protected final GroupChannel channel;
+        protected final long sleepTime;
         public HeartbeatThread(GroupChannel channel, long sleepTime) {
             super();
             this.setPriority(MIN_PRIORITY);

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java?rev=1366727&r1=1366726&r2=1366727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java Sat Jul 28 18:33:19
2012
@@ -48,7 +48,8 @@ public class RpcChannel implements Chann
     private byte[] rpcId;
     private int replyMessageOptions = 0;
 
-    private HashMap<RpcCollectorKey, RpcCollector> responseMap = new HashMap<RpcCollectorKey,
RpcCollector>();
+    private final HashMap<RpcCollectorKey, RpcCollector> responseMap =
+            new HashMap<>();
 
     /**
      * Create an RPC channel. You can have several RPC channels attached to a group
@@ -226,11 +227,11 @@ public class RpcChannel implements Chann
      * @version 1.0
      */
     public static class RpcCollector {
-        public ArrayList<Response> responses = new ArrayList<Response>();
-        public RpcCollectorKey key;
-        public int options;
+        public final ArrayList<Response> responses = new ArrayList<>();
+        public final RpcCollectorKey key;
+        public final int options;
         public int destcnt;
-        public long timeout;
+        public final long timeout;
 
         public RpcCollector(RpcCollectorKey key, int options, int destcnt, long timeout)
{
             this.key = key;
@@ -280,7 +281,7 @@ public class RpcChannel implements Chann
     }
 
     public static class RpcCollectorKey {
-        byte[] id;
+        final byte[] id;
         public RpcCollectorKey(byte[] id) {
             this.id = id;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message