activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-653 Possible Null Pointer Exception during message properties read using XmlDataImporter
Date Mon, 25 Jul 2016 18:33:02 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a6e934e18 -> bd2722503


ARTEMIS-653 Possible Null Pointer Exception during message properties read using XmlDataImporter

Create SimpleString object only if value of attribute is not null


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

Branch: refs/heads/master
Commit: 46aad5b3a73bd429296540dc423e920eb977f6b4
Parents: a6e934e
Author: Martin Styk <mstyk@redhat.com>
Authored: Mon Jul 25 17:21:50 2016 +0200
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Jul 25 14:32:46 2016 -0400

----------------------------------------------------------------------
 .../artemis/cli/commands/tools/XmlDataImporter.java      | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/46aad5b3/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataImporter.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataImporter.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataImporter.java
index 694525d..8a355d1 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataImporter.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataImporter.java
@@ -376,7 +376,8 @@ public final class XmlDataImporter extends ActionAbstract {
       String key = "";
       String value = "";
       String propertyType = "";
-      String realValue = null;
+      String realStringValue = null;
+      SimpleString realSimpleStringValue = null;
 
       for (int i = 0; i < reader.getAttributeCount(); i++) {
          String attributeName = reader.getAttributeLocalName(i);
@@ -420,15 +421,15 @@ public final class XmlDataImporter extends ActionAbstract {
             break;
          case XmlDataConstants.PROPERTY_TYPE_SIMPLE_STRING:
             if (!value.equals(XmlDataConstants.NULL)) {
-               realValue = value;
+               realSimpleStringValue = new SimpleString(value);
             }
-            message.putStringProperty(new SimpleString(key), new SimpleString(realValue));
+            message.putStringProperty(new SimpleString(key), realSimpleStringValue);
             break;
          case XmlDataConstants.PROPERTY_TYPE_STRING:
             if (!value.equals(XmlDataConstants.NULL)) {
-               realValue = value;
+               realStringValue = value;
             }
-            message.putStringProperty(key, realValue);
+            message.putStringProperty(key, realStringValue);
             break;
       }
    }


Mime
View raw message