[hornetq-commits] JBoss hornetq SVN: r11618 - branches/Branch_2_2_EAP/src/main/org/hornetq/utils.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Oct 29 22:21:53 EDT 2011


Author: clebert.suconic
Date: 2011-10-29 22:21:53 -0400 (Sat, 29 Oct 2011)
New Revision: 11618

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java
Log:
Reverting changes

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java	2011-10-29 21:33:03 UTC (rev 11617)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java	2011-10-30 02:21:53 UTC (rev 11618)
@@ -25,12 +25,8 @@
 import static org.hornetq.utils.DataConstants.SHORT;
 import static org.hornetq.utils.DataConstants.STRING;
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.nio.ByteBuffer;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
@@ -142,7 +138,7 @@
       checkCreateProperties();
       doPutValue(key, value == null ? new NullValue() : new StringValue(value));
    }
-
+   
    public void putNullValue(final SimpleString key)
    {
       checkCreateProperties();
@@ -608,65 +604,9 @@
    @Override
    public String toString()
    {
-      StringWriter strWriter = new StringWriter();
-      PrintWriter out = new PrintWriter(strWriter);
-      Iterator<Entry<SimpleString, PropertyValue>> propIter = properties.entrySet().iterator();
-      while (propIter.hasNext())
-      {
-         Entry<SimpleString, PropertyValue> item = propIter.next();
-
-         // When debugging TypedProperties, we need to identify the actual array on PrintData and other log outputs
-         if (item.getKey().toString().startsWith("_HQ_ROUTE_TO"))
-         {
-            String outstr = toLongArray(item.getValue());
-            
-            out.print(item.getKey() + "=" + outstr);
-         }
-         else
-         {
-            out.print(item.getKey() + "=" + item.getValue());
-         }
-         if (propIter.hasNext())
-         {
-            out.print(",");
-         }
-      }
-      return "TypedProperties[" + strWriter.toString() + "]";
+      return "TypedProperties[" + properties + "]";
    }
 
-   /**
-    * @param item
-    * @return
-    */
-   private String toLongArray(PropertyValue value)
-   {
-      StringBuffer outstr = new StringBuffer();
-
-      try
-      {
-         byte[] ids = (byte [])value.getValue();
-
-         ByteBuffer buff = ByteBuffer.wrap(ids);
-
-         while (buff.hasRemaining())
-         {
-            long bindingID = buff.getLong();
-            outstr.append(bindingID);
-            if (buff.hasRemaining())
-            {
-               outstr.append(",");
-            }
-         }
-      }
-      catch (Throwable e)
-      {
-         log.warn(e.getMessage(), e);
-         outstr = new StringBuffer();
-         outstr.append(value.toString());
-      }
-      return "[" + outstr.toString() + "]";
-   }
-
    // Private ------------------------------------------------------------------------------------
 
    private void checkCreateProperties()



More information about the hornetq-commits mailing list