Source:
static ModelNode resolveEnhancedSyntax(final String attributeExpression, final ModelNode model, AttributeDefinition attributeDefinition) throws OperationFailedException { ModelNode result = model; String[] parts = attributeExpression.split("\\."); for (int i = 0; i < parts.length; i++) { String part = parts[i]; Matcher matcher = BRACKETS_PATTERN.matcher(part); if (matcher.matches()) { String attribute = matcher.group(1); int index = Integer.parseInt(matcher.group(2)); ModelNode list = attribute.isEmpty() ? result : result.get(attribute); if (list.isDefined() && list.getType() == ModelType.LIST && index >= 0) { result = list.get(index); if (i < parts.length - 1) { attributeDefinition = attributeDefinition instanceof ObjectListAttributeDefinition ? ((ObjectListAttributeDefinition) attributeDefinition).getValueType() : null; } } else { if (index < 0) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpressionIndex(attributeExpression, index); } else { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpressionList(attributeExpression); } } } else { if (i < parts.length - 1 && !result.hasDefined(part)) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } if (result.has(part)) { result = result.get(part); } else { if (attributeDefinition instanceof ObjectTypeAttributeDefinition) { AttributeDefinition[] fields = ((ObjectTypeAttributeDefinition) attributeDefinition).getValueTypes(); attributeDefinition = null; for (AttributeDefinition field : fields) { if (field.getName().equals(part)) { attributeDefinition = field; break; } } if (attributeDefinition == null) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } result = result.get(part); } else { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } } } } return result; }

Target:
static ModelNode resolveEnhancedSyntax(final String attributeExpression, final ModelNode model, AttributeDefinition attributeDefinition) throws OperationFailedException { assert attributeExpression != null; ModelNode result = model; String[] parts = attributeExpression.split("\\."); for (int i = 0; i < parts.length; i++) { String part = parts[i]; Matcher matcher = BRACKETS_PATTERN.matcher(part); if (matcher.matches()) { String attribute = matcher.group(1); int index = Integer.parseInt(matcher.group(2)); ModelNode list = attribute.isEmpty() ? result : result.get(attribute); if (list.isDefined() && list.getType() == ModelType.LIST && index >= 0) { result = list.get(index); if (i < parts.length - 1) { attributeDefinition = attributeDefinition instanceof ObjectListAttributeDefinition ? ((ObjectListAttributeDefinition) attributeDefinition).getValueType() : null; } } else { if (index < 0) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpressionIndex(attributeExpression, index); } else { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpressionList(attributeExpression); } } } else { if (i < parts.length - 1 && !result.hasDefined(part)) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } if (result.has(part)) { result = result.get(part); } else { if (attributeDefinition instanceof ObjectTypeAttributeDefinition) { AttributeDefinition[] fields = ((ObjectTypeAttributeDefinition) attributeDefinition).getValueTypes(); attributeDefinition = null; for (AttributeDefinition field : fields) { if (field.getName().equals(part)) { attributeDefinition = field; break; } } if (attributeDefinition == null) { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } result = result.get(part); } else { throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression); } } } } return result; }