[hornetq-commits] JBoss hornetq SVN: r11211 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Aug 15 08:18:52 EDT 2011


Author: ataylor
Date: 2011-08-15 08:18:52 -0400 (Mon, 15 Aug 2011)
New Revision: 11211

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
Log:
fix npe in postofficeimpl

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2011-08-15 12:11:47 UTC (rev 11210)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2011-08-15 12:18:52 UTC (rev 11211)
@@ -18,6 +18,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -841,18 +842,34 @@
     */
    protected void cleanupInternalPropertiesBeforeRouting(final ServerMessage message)
    {
+      LinkedList<SimpleString> valuesToRemove = null;
+
+
       for (SimpleString name : message.getPropertyNames())
       {
          // We use properties to establish routing context on clustering.
          // However if the client resends the message after receiving, it needs to be removed
          if (name.startsWith(MessageImpl.HDR_ROUTE_TO_IDS) && !name.equals(MessageImpl.HDR_ROUTE_TO_IDS))
          {
-            message.removeProperty(name);
+            if (valuesToRemove == null)
+            {
+               valuesToRemove = new LinkedList<SimpleString>();
+            }
+            valuesToRemove.add(name);
          }
       }
+
+      if (valuesToRemove != null)
+      {
+         for (SimpleString removal : valuesToRemove)
+         {
+           message.removeProperty(removal);
+         }
+      }
    }
 
 
+
    private void setPagingStore(final ServerMessage message) throws Exception
    {
       PagingStore store = pagingManager.getPageStore(message.getAddress());



More information about the hornetq-commits mailing list