From 62cb9b22dedcf45be260bfc7db952a6e81486c0a Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Thu, 30 Mar 2017 16:43:24 -0400 Subject: [PATCH] ARTEMIS-1086 Proper conversion of SimpleString to String When adding boolean value keyed by SimpleString the key needs to be converted to a String type to be valid AMQP. --- .../artemis/protocol/amqp/broker/AMQPMessage.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java index 08953a29ce..d2a91dfb80 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java @@ -139,9 +139,10 @@ public class AMQPMessage extends RefCountMessage { } } - private Map getApplicationPropertiesMap() { + @SuppressWarnings("unchecked") + private Map getApplicationPropertiesMap() { ApplicationProperties appMap = getApplicationProperties(); - Map map = null; + Map map = null; if (appMap != null) { map = appMap.getValue(); @@ -216,7 +217,7 @@ public class AMQPMessage extends RefCountMessage { private Object getSymbol(Symbol symbol) { MessageAnnotations annotations = getMessageAnnotations(); - Map mapAnnotations = annotations != null ? annotations.getValue() : null; + Map mapAnnotations = annotations != null ? annotations.getValue() : null; if (mapAnnotations != null) { return mapAnnotations.get(symbol); } @@ -226,7 +227,7 @@ public class AMQPMessage extends RefCountMessage { private Object removeSymbol(Symbol symbol) { MessageAnnotations annotations = getMessageAnnotations(); - Map mapAnnotations = annotations != null ? annotations.getValue() : null; + Map mapAnnotations = annotations != null ? annotations.getValue() : null; if (mapAnnotations != null) { return mapAnnotations.remove(symbol); } @@ -245,7 +246,7 @@ public class AMQPMessage extends RefCountMessage { _messageAnnotations = new MessageAnnotations(new HashMap<>()); annotations = _messageAnnotations; } - Map mapAnnotations = annotations != null ? annotations.getValue() : null; + Map mapAnnotations = annotations != null ? annotations.getValue() : null; if (mapAnnotations != null) { mapAnnotations.put(symbol, value); } @@ -700,7 +701,7 @@ public class AMQPMessage extends RefCountMessage { @Override public org.apache.activemq.artemis.api.core.Message putBooleanProperty(SimpleString key, boolean value) { - getApplicationPropertiesMap().put(key, Boolean.valueOf(value)); + getApplicationPropertiesMap().put(key.toString(), Boolean.valueOf(value)); return this; }