New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WFLY-572] : "Cast" model nodes in AttributeDefinition validateOperation() #77
Conversation
@@ -445,6 +446,52 @@ public final void validateAndSet(ModelNode operationObject, final ModelNode mode | |||
model.get(name).set(node); | |||
} | |||
|
|||
private void convertToExpectedType(final ModelNode result, final ModelNode node) { | |||
if (node.getType() == ModelType.EXPRESSION || Util.isExpression(node.asString()) || !node.isDefined()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this.type == node.getType() there is no need to do any other conversion.
Once all issues in the in-line comments are resolved, please use the WildFly / WildFly Core Integration Experiments job at http://brontes.lab.eng.brq.redhat.com/viewType.html?buildTypeId=WF_WildFlyCoreIntegrationExperiments to test this branch against wildfly/master and post the link to the results here. See my recent email to the jboss-as internal list for info on how to use that job -- it's a bit tricky as you have to alter the config of the WildFly Core / Experiments job first. |
WildFly / WildFly Core Integration Experiments : http://brontes.lab.eng.brq.redhat.com/viewLog.html?buildTypeId=WF_WildFlyCoreIntegrationExperiments&buildId=19697 |
if (node.getType() == type || node.getType() == ModelType.EXPRESSION || Util.isExpression(node.asString()) || !node.isDefined()) { | ||
return node; | ||
} | ||
ModelNode result = node.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can just be new ModelNode(). In all cases in the switch the ModelValue inside the node is replaced, so the cost of cloning is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, most efficient is to just declare the variable here and initialize it in the switch cases.
…ion() COnvert the attribute in operation to the expected ModelType when it is possible.
[WFLY-572] : "Cast" model nodes in AttributeDefinition validateOperation()
https://issues.jboss.org/browse/JBEAP-2202 Connecting to controller v…
Convert the attribute in operation to the expected ModelType when it is possible.
Jira: https://issues.jboss.org/browse/WFLY-572