summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2014-10-21 12:43:25 +0000
committerRobert Godfrey <rgodfrey@apache.org>2014-10-21 12:43:25 +0000
commit891e82061b6d4c5f9901416bdf2ab3ee0a2ea6b8 (patch)
treee01ab2a96b95d4f7f1a0a0f228f0305e699e07da /qpid/java
parent814767e56ff8cdafa4232d31a61e7be526eae786 (diff)
downloadqpid-python-891e82061b6d4c5f9901416bdf2ab3ee0a2ea6b8.tar.gz
QPID-6172 : Ensure the type attribute is always present in the actual attribute map
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1633361 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
index 9a1307c8dd..bfd1d83249 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
@@ -225,7 +225,7 @@ public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> im
if(idObj == null)
{
uuid = UUID.randomUUID();
- attributes = new HashMap<String, Object>(attributes);
+ attributes = new LinkedHashMap<>(attributes);
attributes.put(ID, uuid);
}
else
@@ -247,6 +247,11 @@ public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> im
throw new IllegalConfigurationException("Provided type is " + attributes.get(TYPE)
+ " but calculated type is " + _type);
}
+ else if(attributes.get(TYPE) == null)
+ {
+ attributes = new LinkedHashMap<>(attributes);
+ attributes.put(TYPE, _type);
+ }
for (Class<? extends ConfiguredObject> childClass : getModel().getChildTypes(getCategoryClass()))
{