From 891e82061b6d4c5f9901416bdf2ab3ee0a2ea6b8 Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Tue, 21 Oct 2014 12:43:25 +0000 Subject: 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 --- .../org/apache/qpid/server/model/AbstractConfiguredObject.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qpid/java') 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> im if(idObj == null) { uuid = UUID.randomUUID(); - attributes = new HashMap(attributes); + attributes = new LinkedHashMap<>(attributes); attributes.put(ID, uuid); } else @@ -247,6 +247,11 @@ public abstract class AbstractConfiguredObject> 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 childClass : getModel().getChildTypes(getCategoryClass())) { -- cgit v1.2.1