fixed NPE

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@382888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-03 17:08:40 +00:00
parent 4759540e6e
commit dc168c055b
1 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,7 @@ public class ActiveMQMessage extends Message implements javax.jms.Message {
}
transient protected Callback acknowledgeCallback;
transient int hashCode;
public Message copy() {
ActiveMQMessage copy = new ActiveMQMessage();
@ -64,7 +65,13 @@ public class ActiveMQMessage extends Message implements javax.jms.Message {
}
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) {