Skip to content
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

Merged
merged 1 commit into from Aug 14, 2014

Conversation

ehsavoie
Copy link
Contributor

@ehsavoie ehsavoie commented Aug 5, 2014

Convert the attribute in operation to the expected ModelType when it is possible.
Jira: https://issues.jboss.org/browse/WFLY-572

@wildfly-ci
Copy link

Build 139 is now running using a merge of 7b53db3

@wildfly-ci
Copy link

Build 139 outcome was SUCCESS using a merge of 7b53db3
Summary: Tests passed: 2546, ignored: 57 Build time: 0:14:38

@@ -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()) {
Copy link
Contributor

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.

@bstansberry
Copy link
Contributor

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-ci
Copy link

Build 165 is now running using a merge of 4c64d92

@wildfly-ci
Copy link

Build 165 outcome was SUCCESS using a merge of 4c64d92
Summary: Tests passed: 2552, ignored: 57 Build time: 0:16:02

@wildfly-ci
Copy link

Build 166 is now running using a merge of 8813f75

@wildfly-ci
Copy link

Build 166 outcome was SUCCESS using a merge of 8813f75
Summary: Tests passed: 2552, ignored: 57 Build time: 0:15:47

@ehsavoie
Copy link
Contributor Author

ehsavoie commented Aug 8, 2014

if (node.getType() == type || node.getType() == ModelType.EXPRESSION || Util.isExpression(node.asString()) || !node.isDefined()) {
return node;
}
ModelNode result = node.clone();
Copy link
Contributor

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.

Copy link
Contributor

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.
@wildfly-ci
Copy link

Build 183 is now running using a merge of f5413ec

@wildfly-ci
Copy link

Build 183 outcome was SUCCESS using a merge of f5413ec
Summary: Tests passed: 2557, ignored: 57 Build time: 0:15:47

bstansberry added a commit that referenced this pull request Aug 14, 2014
[WFLY-572] : "Cast" model nodes in AttributeDefinition validateOperation()
@bstansberry bstansberry merged commit 3d568a2 into wildfly:master Aug 14, 2014
@ehsavoie ehsavoie deleted the WFLY-572 branch August 20, 2014 07:29
iweiss pushed a commit to iweiss/wildfly-core that referenced this pull request Jun 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants