Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 71624 invoked from network); 5 Mar 2011 17:15:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Mar 2011 17:15:51 -0000 Received: (qmail 23513 invoked by uid 500); 5 Mar 2011 17:15:51 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 23484 invoked by uid 500); 5 Mar 2011 17:15:50 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 23476 invoked by uid 99); 5 Mar 2011 17:15:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 17:15:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 17:15:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 767D22388A3B; Sat, 5 Mar 2011 17:15:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1078312 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java Date: Sat, 05 Mar 2011 17:15:25 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110305171525.767D22388A3B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Mar 5 17:15:25 2011 New Revision: 1078312 URL: http://svn.apache.org/viewvc?rev=1078312&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQ-3202 Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java?rev=1078312&r1=1078311&r2=1078312&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java Sat Mar 5 17:15:25 2011 @@ -20,6 +20,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ObjectStreamException; import java.io.OutputStream; import java.util.Collections; import java.util.Enumeration; @@ -71,14 +72,14 @@ import org.apache.activemq.wireformat.Wi * String representation of the primitive. *

* A value written as the row type can be read as the column type.

- * + * *

  * | | boolean byte short char int long float double String byte[] |----------------------------------------------------------------------
  * |boolean | X X |byte | X X X X X |short | X X X X |char | X X |int | X X X |long | X X |float | X X X |double | X X
  * |String | X X X X X X X X |byte[] | X |----------------------------------------------------------------------
  * <p/>
  * 
- * + * *

*

* Attempting to read a null value as a primitive type must be treated as @@ -86,7 +87,7 @@ import org.apache.activemq.wireformat.Wi * conversion method with a null value. Since char does not * support a String conversion, attempting to read a null value * as a char must throw a NullPointerException. - * + * * @openwire:marshaller code="25" * @see javax.jms.Session#createMapMessage() * @see javax.jms.BytesMessage @@ -101,6 +102,13 @@ public class ActiveMQMapMessage extends protected transient Map map = new HashMap(); + private Object readResolve() throws ObjectStreamException { + if(this.map == null) { + this.map = new HashMap(); + } + return this; + } + public Message copy() { ActiveMQMapMessage copy = new ActiveMQMapMessage(); copy(copy); @@ -145,7 +153,7 @@ public class ActiveMQMapMessage extends /** * Builds the message body from data - * + * * @throws JMSException * @throws IOException */ @@ -189,7 +197,7 @@ public class ActiveMQMapMessage extends /** * Returns the boolean value with the specified name. - * + * * @param name the name of the boolean * @return the boolean value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -214,7 +222,7 @@ public class ActiveMQMapMessage extends /** * Returns the byte value with the specified name. - * + * * @param name the name of the byte * @return the byte value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -239,7 +247,7 @@ public class ActiveMQMapMessage extends /** * Returns the short value with the specified name. - * + * * @param name the name of the short * @return the short value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -267,7 +275,7 @@ public class ActiveMQMapMessage extends /** * Returns the Unicode character value with the specified name. - * + * * @param name the name of the Unicode character * @return the Unicode character value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -289,7 +297,7 @@ public class ActiveMQMapMessage extends /** * Returns the int value with the specified name. - * + * * @param name the name of the int * @return the int value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -320,7 +328,7 @@ public class ActiveMQMapMessage extends /** * Returns the long value with the specified name. - * + * * @param name the name of the long * @return the long value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -354,7 +362,7 @@ public class ActiveMQMapMessage extends /** * Returns the float value with the specified name. - * + * * @param name the name of the float * @return the float value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -379,7 +387,7 @@ public class ActiveMQMapMessage extends /** * Returns the double value with the specified name. - * + * * @param name the name of the double * @return the double value with the specified name * @throws JMSException if the JMS provider fails to read the message due to @@ -407,7 +415,7 @@ public class ActiveMQMapMessage extends /** * Returns the String value with the specified name. - * + * * @param name the name of the String * @return the String value with the specified name; if there * is no item by this name, a null value is returned @@ -430,7 +438,7 @@ public class ActiveMQMapMessage extends /** * Returns the byte array value with the specified name. - * + * * @param name the name of the byte array * @return a copy of the byte array value with the specified name; if there * is no item by this name, a null value is returned. @@ -458,7 +466,7 @@ public class ActiveMQMapMessage extends *

* Note that byte values are returned as byte[], not * Byte[]. - * + * * @param name the name of the Java object * @return a copy of the Java object value with the specified name, in * objectified format (for example, if the object was set as an @@ -475,7 +483,7 @@ public class ActiveMQMapMessage extends /** * Returns an Enumeration of all the names in the * MapMessage object. - * + * * @return an enumeration of all the names in this MapMessage * @throws JMSException */ @@ -496,7 +504,7 @@ public class ActiveMQMapMessage extends /** * Sets a boolean value with the specified name into the Map. - * + * * @param name the name of the boolean * @param value the boolean value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -512,7 +520,7 @@ public class ActiveMQMapMessage extends /** * Sets a byte value with the specified name into the Map. - * + * * @param name the name of the byte * @param value the byte value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -528,7 +536,7 @@ public class ActiveMQMapMessage extends /** * Sets a short value with the specified name into the Map. - * + * * @param name the name of the short * @param value the short value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -544,7 +552,7 @@ public class ActiveMQMapMessage extends /** * Sets a Unicode character value with the specified name into the Map. - * + * * @param name the name of the Unicode character * @param value the Unicode character value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -560,7 +568,7 @@ public class ActiveMQMapMessage extends /** * Sets an int value with the specified name into the Map. - * + * * @param name the name of the int * @param value the int value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -576,7 +584,7 @@ public class ActiveMQMapMessage extends /** * Sets a long value with the specified name into the Map. - * + * * @param name the name of the long * @param value the long value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -592,7 +600,7 @@ public class ActiveMQMapMessage extends /** * Sets a float value with the specified name into the Map. - * + * * @param name the name of the float * @param value the float value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -608,7 +616,7 @@ public class ActiveMQMapMessage extends /** * Sets a double value with the specified name into the Map. - * + * * @param name the name of the double * @param value the double value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -624,7 +632,7 @@ public class ActiveMQMapMessage extends /** * Sets a String value with the specified name into the Map. - * + * * @param name the name of the String * @param value the String value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -640,7 +648,7 @@ public class ActiveMQMapMessage extends /** * Sets a byte array value with the specified name into the Map. - * + * * @param name the name of the byte array * @param value the byte array value to set in the Map; the array is copied * so that the value for name will not be @@ -663,7 +671,7 @@ public class ActiveMQMapMessage extends /** * Sets a portion of the byte array value with the specified name into the * Map. - * + * * @param name the name of the byte array * @param value the byte array value to set in the Map * @param offset the initial offset within the byte array @@ -687,7 +695,7 @@ public class ActiveMQMapMessage extends * This method works only for the objectified primitive object types (Integer,Double, * Long  ...), String objects, and byte * arrays. - * + * * @param name the name of the Java object * @param value the Java object value to set in the Map * @throws JMSException if the JMS provider fails to write the message due @@ -713,7 +721,7 @@ public class ActiveMQMapMessage extends /** * Indicates whether an item exists in this MapMessage * object. - * + * * @param name the name of the item to test * @return true if the item exists * @throws JMSException if the JMS provider fails to determine if the item