Source:
private void validateNestedAttributes(ModelNode subModel, ObjectTypeAttributeDefinition attr, String absoluteParentName) throws OperationFailedException { if (!subModel.isDefined()) { return; } AttributeDefinition[] subAttrs = attr.getValueTypes(); Map<String, AttributeDefinition> visited = new HashMap<>(); for (AttributeDefinition subAttr : subAttrs) { String subAttributeName = subAttr.getName(); visited.put(subAttributeName, subAttr); String absoluteName = absoluteParentName + "." + subAttributeName; if (!subModel.hasDefined(subAttributeName) && isRequired(subAttr, subModel)) { throw new OperationFailedException(ControllerLogger.MGMT_OP_LOGGER.required(subAttributeName)); } if (!subModel.hasDefined(subAttributeName)) { continue; } String[] requires = subAttr.getRequires(); if (requires != null) { for (final String required : requires) { if (!subModel.hasDefined(required)) { AttributeDefinition requiredAttr = getAttributeDefinition(required, subAttrs, visited); if (requiredAttr == null) { ControllerLogger.MGMT_OP_LOGGER.debugf("AttributeDefinition for %s required by %s of %s is null", required, subAttributeName, absoluteParentName); } else if (!hasAlternative(getRelevantAlteratives(requiredAttr.getAlternatives(), requires), subModel)) { throw ControllerLogger.MGMT_OP_LOGGER.requiredAttributeNotSet(absoluteParentName + "." + required, absoluteName); } } } } if (!isAllowed(subAttr, subModel)) { String[] alts = subAttr.getAlternatives(); StringBuilder sb = null; if (alts != null) { for (String alt : alts) { if (subModel.hasDefined(alt)) { if (sb == null) { sb = new StringBuilder(); } else { sb.append(", "); } sb.append(absoluteParentName + "." + alt); } } } throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.invalidAttributeCombo(absoluteName, sb)); } handleObjectAttributes(subModel, subAttr, absoluteName); } }

Target:
private void validateNestedAttributes(ModelNode subModel, ObjectTypeAttributeDefinition attr, String absoluteParentName) throws OperationFailedException { if (!subModel.isDefined()) { return; } AttributeDefinition[] subAttrs = attr.getValueTypes(); for (AttributeDefinition subAttr : subAttrs) { String subAttributeName = subAttr.getName(); String absoluteName = absoluteParentName + "." + subAttributeName; if (!subModel.hasDefined(subAttributeName) && isRequired(subAttr, subModel)) { throw new OperationFailedException(ControllerLogger.MGMT_OP_LOGGER.required(subAttributeName)); } if (!subModel.hasDefined(subAttributeName)) { continue; } String[] requires = subAttr.getRequires(); if (requires != null) { for (final String required : requires) { if (!subModel.hasDefined(required)) { AttributeDefinition requiredAttr = getAttributeDefinition(required, subAttrs); if (requiredAttr == null) { ControllerLogger.MGMT_OP_LOGGER.debugf("AttributeDefinition for %s required by %s of %s is null", required, subAttributeName, absoluteParentName); } else if (!hasAlternative(getRelevantAlteratives(requiredAttr.getAlternatives(), requires), subModel)) { throw ControllerLogger.MGMT_OP_LOGGER.requiredAttributeNotSet(absoluteParentName + "." + required, absoluteName); } } } } if (!isAllowed(subAttr, subModel)) { String[] alts = subAttr.getAlternatives(); StringBuilder sb = null; if (alts != null) { for (String alt : alts) { if (subModel.hasDefined(alt)) { if (sb == null) { sb = new StringBuilder(); } else { sb.append(", "); } sb.append(absoluteParentName + "." + alt); } } } throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.invalidAttributeCombo(absoluteName, sb)); } handleObjectAttributes(subModel, subAttr, absoluteName); } }