[1/2] activemq-artemis git commit: This closes #1846

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/2] activemq-artemis git commit: This closes #1846

michaelpearce
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 9c40a514f -> 56e1df3c3


This closes #1846


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/56e1df3c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/56e1df3c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/56e1df3c

Branch: refs/heads/master
Commit: 56e1df3c3a4d55643fc46eb242940a12f4d91b64
Parents: 9c40a51 f09ee40
Author: Michael Pearce <[hidden email]>
Authored: Tue Feb 6 03:16:53 2018 +0000
Committer: Michael Pearce <[hidden email]>
Committed: Tue Feb 6 03:16:53 2018 +0000

----------------------------------------------------------------------
 .../apache/activemq/artemis/core/message/impl/CoreMessage.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

[2/2] activemq-artemis git commit: Avoid NPE when setting null address

michaelpearce
Avoid NPE when setting null address


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/f09ee40b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/f09ee40b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/f09ee40b

Branch: refs/heads/master
Commit: f09ee40b538ec739b745cb9678131cf706fb1f08
Parents: 9c40a51
Author: Justin Bertram <[hidden email]>
Authored: Fri Feb 2 16:05:20 2018 -0600
Committer: Michael Pearce <[hidden email]>
Committed: Tue Feb 6 03:16:53 2018 +0000

----------------------------------------------------------------------
 .../apache/activemq/artemis/core/message/impl/CoreMessage.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f09ee40b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
index 888b785..0fb7c3e 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
@@ -437,7 +437,11 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
 
    @Override
    public CoreMessage setAddress(SimpleString address) {
-      if (validBuffer && !address.equals(this.address)) {
+      if (address == null && this.address == null) {
+         // no-op so just return
+         return this;
+      }
+      if (validBuffer && (address == null || !address.equals(this.address))) {
          messageChanged();
       }
       this.address = address;