activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r382888 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
Date Fri, 03 Mar 2006 17:08:46 GMT
Author: jstrachan
Date: Fri Mar  3 09:08:40 2006
New Revision: 382888

URL: http://svn.apache.org/viewcvs?rev=382888&view=rev
Log:
fixed NPE

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java?rev=382888&r1=382887&r2=382888&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
Fri Mar  3 09:08:40 2006
@@ -50,6 +50,7 @@
     }
 
     transient protected Callback acknowledgeCallback;
+    transient int hashCode;
 
     public Message copy() {
         ActiveMQMessage copy = new ActiveMQMessage();
@@ -64,7 +65,13 @@
     }
 
     public int hashCode() {
-        return this.getMessageId().hashCode();
+        MessageId id = getMessageId();
+        if (id != null) {
+            return  id.hashCode();
+        }
+        else {
+            return super.hashCode();
+        }
     }
 
     public boolean equals(Object o) {



Mime
View raw message