diff --git a/domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml.java b/domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml.java index 291f063..b55f23f 100644 --- a/domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml.java +++ b/domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml.java @@ -3342,13 +3342,11 @@ public class ManagementXml { final Element element = Element.forName(reader.getLocalName()); switch (element) { case INCLUDE: { - ModelNode includeAddr = addr.clone().add(INCLUDE); - parseIncludeExclude(reader, includeAddr, expectedNs, list); + parseIncludeExclude(reader, addr.clone(), INCLUDE, expectedNs, list); break; } case EXCLUDE: { - ModelNode excludeAddr = addr.clone().add(EXCLUDE); - parseIncludeExclude(reader, excludeAddr, expectedNs, list); + parseIncludeExclude(reader, addr.clone(), EXCLUDE, expectedNs, list); break; } default: { @@ -3358,8 +3356,8 @@ public class ManagementXml { } } - private static void parseIncludeExclude(final XMLExtendedStreamReader reader, final ModelNode address, final Namespace expectedNs, - final List list) throws XMLStreamException { + private static void parseIncludeExclude(final XMLExtendedStreamReader reader, final ModelNode address, String type, + final Namespace expectedNs, final List list) throws XMLStreamException { ParseUtils.requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { @@ -3367,11 +3365,11 @@ public class ManagementXml { final Element element = Element.forName(reader.getLocalName()); switch (element) { case GROUP: { - parsePrincipal(reader, address, GROUP, expectedNs, list); + parsePrincipal(reader, address, type, GROUP, expectedNs, list); break; } case USER: { - parsePrincipal(reader, address, USER, expectedNs, list); + parsePrincipal(reader, address, type, USER, expectedNs, list); break; } default: { @@ -3381,8 +3379,8 @@ public class ManagementXml { } } - private static void parsePrincipal(final XMLExtendedStreamReader reader, final ModelNode address, final String type, - final Namespace expectedNs, final List list) throws XMLStreamException { + private static void parsePrincipal(final XMLExtendedStreamReader reader, final ModelNode address, + final String parentType, final String type, final Namespace expectedNs, final List list) throws XMLStreamException { String alias = null; String realm = null; String name = null; @@ -3425,7 +3423,7 @@ public class ManagementXml { } String addrValue = alias == null ? generateAlias(type, name, realm) : alias; - ModelNode addAddr = address.clone().add(addrValue); + ModelNode addAddr = address.clone().add(parentType, addrValue); addOp.get(OP_ADDR).set(addAddr); list.add(addOp);