Skip to content

Commit 9991ee1

Browse files
Working on #13486
This change should assign a value to the existing variable instead of declaring a new variable. This commit breaks some tests and this branch is currently a WIP.
1 parent c2a2be9 commit 9991ee1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ protected void initializeCommandObjectParameter(final BlockStatement wrapper,
846846
final ArgumentListExpression initializeCommandObjectArguments = args(classX(commandObjectNode), constX(paramName));
847847
final MethodCallExpression initializeCommandObjectMethodCall = callThisX("initializeCommandObject", initializeCommandObjectArguments);
848848
applyDefaultMethodTarget(initializeCommandObjectMethodCall, commandObjectNode);
849-
final Expression assignCommandObjectToParameter = declX(localVarX(paramName), initializeCommandObjectMethodCall);
849+
final Expression assignCommandObjectToParameter = assignX(varX(paramName, commandObjectNode), initializeCommandObjectMethodCall);
850850
wrapper.addStatement(stmt(assignCommandObjectToParameter));
851851
}
852852

0 commit comments

Comments
 (0)