[hornetq-commits] JBoss hornetq SVN: r11964 - in trunk/hornetq-core/src/main/java/org/hornetq/core: deployers/impl and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 4 11:42:35 EST 2012


Author: borges
Date: 2012-01-04 11:42:34 -0500 (Wed, 04 Jan 2012)
New Revision: 11964

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/ChannelImpl.java
Log:
Fix findbugs warnings

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -210,7 +210,7 @@
 
    // Inner classes -------------------------------------------------
 
-   protected class HornetQOutputStream extends OutputStream
+   protected static class HornetQOutputStream extends OutputStream
    {
       HornetQBuffer bufferOut;
 
@@ -219,9 +219,6 @@
          this.bufferOut = out;
       }
 
-      /* (non-Javadoc)
-       * @see java.io.OutputStream#write(int)
-       */
       @Override
       public void write(int b) throws IOException
       {

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -44,11 +44,11 @@
    private Executor executor = null;
 
    /** Used to debug operations.
-    * 
+    *
     *  Someone may argue this is not needed. But it's impossible to debg anything related to topology without knowing what node
     *  or what object missed a Topology update.
-    *  
-    *  Hence I added some information to locate debugging here. 
+    *
+    *  Hence I added some information to locate debugging here.
     *  */
    private volatile Object owner;
 
@@ -148,9 +148,9 @@
    }
 
    /**
-    * 
+    *
     * @param <p>uniqueIdentifier an unique identifier for when the change was made
-    *           We will use current time millis for starts, and a ++ of that number for shutdown. </p> 
+    *           We will use current time millis for starts, and a ++ of that number for shutdown. </p>
     * @param nodeId
     * @param memberInput
     * @return
@@ -207,7 +207,7 @@
                if (log.isDebugEnabled())
                {
                   log.debug(this + "::updated currentMember=nodeID=" +
-                            nodeId + 
+                            nodeId +
                             ", currentMember=" +
                             currentMember +
                             ", memberInput=" +
@@ -262,7 +262,7 @@
                                         " connector = " +
                                         memberToSend.getConnector());
                   }
-   
+
                   try
                   {
                      listener.nodeUP(uniqueEventID, nodeId, memberToSend.getConnector(), false);
@@ -481,18 +481,17 @@
 
    public synchronized String describe(final String text)
    {
-
-      String desc = text + "topology on " + this + ":\n";
+      StringBuilder desc = new StringBuilder(text + "topology on " + this + ":\n");
       for (Entry<String, TopologyMember> entry : new HashMap<String, TopologyMember>(mapTopology).entrySet())
       {
-         desc += "\t" + entry.getKey() + " => " + entry.getValue() + "\n";
+         desc.append("\t" + entry.getKey() + " => " + entry.getValue() + "\n");
       }
-      desc += "\t" + "nodes=" + nodes() + "\t" + "members=" + members();
+      desc.append("\t" + "nodes=" + nodes() + "\t" + "members=" + members());
       if (mapTopology.isEmpty())
       {
-         desc += "\tEmpty";
+         desc.append("\tEmpty");
       }
-      return desc;
+      return desc.toString();
    }
 
    public int members()

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -14,6 +14,7 @@
 package org.hornetq.core.deployers.impl;
 
 import java.io.File;
+import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URL;
 import java.net.URLDecoder;
@@ -251,7 +252,7 @@
             deployed.remove(pair);
          }
       }
-      catch (Exception e)
+      catch (IOException e)
       {
          FileDeploymentManager.log.warn("error scanning for URL's " + e);
       }
@@ -271,7 +272,7 @@
 
    /**
     * Checks if the URL is among the current thread context class loader's resources.
-    * 
+    *
     * We do not check that the corresponding file exists using File.exists() directly as it would fail
     * in the case the resource is loaded from inside an EAR file (see https://jira.jboss.org/jira/browse/HORNETQ-122)
     */
@@ -291,7 +292,7 @@
             }
          }
       }
-      catch (Exception e)
+      catch (IOException e)
       {
          return false;
       }

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -507,8 +507,14 @@
    public void stopPaging()
    {
       lock.writeLock().lock();
-      paging = false;
-      lock.writeLock().unlock();
+      try
+      {
+         paging = false;
+      }
+      finally
+      {
+         lock.writeLock().unlock();
+      }
    }
 
    public boolean startPaging()
@@ -715,7 +721,7 @@
 
    private final Runnable memoryFreedRunnablesExecutor = new MemoryFreedRunnablesExecutor();
 
-   class OurRunnable implements Runnable
+   static final class OurRunnable implements Runnable
    {
       boolean ran;
 

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -79,7 +79,7 @@
 public class PostOfficeImpl implements PostOffice, NotificationListener, BindingsFactory
 {
    private static final Logger log = Logger.getLogger(PostOfficeImpl.class);
-   
+
    private static final boolean isTrace = log.isTraceEnabled();
 
    public static final SimpleString HDR_RESET_QUEUE_DATA = new SimpleString("_HQ_RESET_QUEUE_DATA");
@@ -472,7 +472,7 @@
       }
 
       String uid = UUIDGenerator.getInstance().generateStringUUID();
-      
+
       if (isTrace)
       {
          log.trace("Sending notification for addBinding " + binding + " from server " + server);
@@ -596,7 +596,7 @@
          return;
       }
 
-      
+
       if (message.hasInternalProperties())
       {
          // We need to perform some cleanup on internal properties,
@@ -692,7 +692,7 @@
       // arrived the target node
       // as described on https://issues.jboss.org/browse/JBPAPP-6130
       ServerMessage copyRedistribute = message.copy(storageManager.generateUniqueID());
-      
+
       Bindings bindings = addressManager.getBindingsForRoutingAddress(message.getAddress());
 
       boolean res = false;
@@ -754,7 +754,7 @@
       {
          throw new IllegalStateException("Cannot find queue " + queueName);
       }
-      
+
       if (log.isDebugEnabled())
       {
          log.debug("PostOffice.sendQueueInfoToQueue on server=" + this.server + ", queueName=" + queueName + " and address=" + address);
@@ -799,7 +799,7 @@
                   message = createQueueInfoMessage(NotificationType.CONSUMER_CREATED, queueName);
 
                   message.putStringProperty(ManagementHelper.HDR_ADDRESS, info.getAddress());
-                  message.putStringProperty(ManagementHelper.HDR_CLUSTER_NAME, info.getClusterName());   
+                  message.putStringProperty(ManagementHelper.HDR_CLUSTER_NAME, info.getClusterName());
                   message.putStringProperty(ManagementHelper.HDR_ROUTING_NAME, info.getRoutingName());
                   message.putIntProperty(ManagementHelper.HDR_DISTANCE, info.getDistance());
 
@@ -890,7 +890,7 @@
       }
    }
 
-   private class PageDelivery extends TransactionOperationAbstract
+   private static class PageDelivery extends TransactionOperationAbstract
    {
       private final Set<Queue> queues = new HashSet<Queue>();
 
@@ -1065,7 +1065,7 @@
          }
          else
          {
-  
+
             storageManager.confirmPendingLargeMessageTX(tx,
                                                         largeServerMessage.getMessageID(),
                                                         largeServerMessage.getPendingRecordID());
@@ -1145,7 +1145,7 @@
             warnMessage.append("Duplicate message detected through the bridge - message will not be routed. Message information:\n");
             warnMessage.append(message.toString());
             PostOfficeImpl.log.warn(warnMessage.toString());
-            
+
             if (context.getTransaction() != null)
             {
                context.getTransaction().markAsRollbackOnly(new HornetQException(HornetQException.DUPLICATE_ID_REJECTED, warnMessage.toString()));
@@ -1327,7 +1327,7 @@
       }
    }
 
-   private class AddOperation implements TransactionOperation
+   private static class AddOperation implements TransactionOperation
    {
       private final List<MessageReference> refs;
 

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/ChannelImpl.java	2012-01-04 14:58:55 UTC (rev 11963)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/ChannelImpl.java	2012-01-04 16:42:34 UTC (rev 11964)
@@ -524,10 +524,9 @@
 
             lock.lock();
 
-            response = packet;
-
             try
             {
+               response = packet;
                sendCondition.signal();
             }
             finally



More information about the hornetq-commits mailing list