Author: djencks
Date: Mon Dec 29 00:02:55 2008
New Revision: 729836

URL: http://svn.apache.org/viewvc?rev=729836&view=rev
Log:
minor code cleanup - more final variables, generics, less unneeded 
initialization

Modified:
    
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java

Modified: 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?rev=729836&r1=729835&r2=729836&view=diff
==============================================================================
--- 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
 (original)
+++ 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
 Mon Dec 29 00:02:55 2008
@@ -80,7 +80,7 @@
     private final Region topicRegion;
     private final Region tempQueueRegion;
     private final Region tempTopicRegion;
-    protected BrokerService brokerService;
+    protected final BrokerService brokerService;
     private boolean started;
     private boolean keepDurableSubsActive;
 
@@ -91,7 +91,7 @@
     private final LongSequenceGenerator sequenceGenerator = new 
LongSequenceGenerator();
     private BrokerId brokerId;
     private String brokerName;
-    private Map<String, ConnectionContext> clientIdSet = new HashMap<String, 
ConnectionContext>(); 
+    private final Map<String, ConnectionContext> clientIdSet = new 
HashMap<String, ConnectionContext>();
     private final DestinationInterceptor destinationInterceptor;
     private ConnectionContext adminConnectionContext;
 
@@ -127,7 +127,7 @@
         case ActiveMQDestination.TEMP_TOPIC_TYPE:
             return tempTopicRegion.getDestinations(destination);
         default:
-            return Collections.EMPTY_SET;
+            return Collections.emptySet();
         }
     }
 
@@ -415,7 +415,7 @@
             ActiveMQDestination destination = message.getDestination();
             // ensure the destination is registered with the RegionBroker
             
producerExchange.getConnectionContext().getBroker().addDestination(producerExchange.getConnectionContext(),
 destination);
-            Region region = null;
+            Region region;
             switch (destination.getDestinationType()) {
             case ActiveMQDestination.QUEUE_TYPE:
                 region = queueRegion;
@@ -440,7 +440,7 @@
     public void acknowledge(ConsumerBrokerExchange consumerExchange, 
MessageAck ack) throws Exception {
         if (consumerExchange.isWildcard() || consumerExchange.getRegion() == 
null) {
             ActiveMQDestination destination = ack.getDestination();
-            Region region = null;
+            Region region;
             switch (destination.getDestinationType()) {
             case ActiveMQDestination.QUEUE_TYPE:
                 region = queueRegion;


Reply via email to