Skip to content

Commit

Permalink
Merge pull request #13696 from paulk-asert/issue13468
Browse files Browse the repository at this point in the history
Move declaration to correct place
  • Loading branch information
jeffscottbrown authored Sep 27, 2024
2 parents 9991ee1 + d699750 commit e9e20d9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,8 @@ protected void initializeAndValidateCommandObjectParameter(final BlockStatement
final ClassNode controllerNode, final ClassNode commandObjectNode,
final ASTNode actionNode, final String actionName, final String paramName,
final SourceUnit source, final GeneratorContext context) {
final DeclarationExpression declareCoExpression = new DeclarationExpression(
new VariableExpression(paramName, commandObjectNode), Token.newSymbol(Types.EQUALS, 0, 0), new EmptyExpression());
wrapper.addStatement(new ExpressionStatement(declareCoExpression));
final DeclarationExpression declareCoExpression = declX(localVarX(paramName, commandObjectNode), new EmptyExpression());
wrapper.addStatement(stmt(declareCoExpression));

if(commandObjectNode.isInterface() || Modifier.isAbstract(commandObjectNode.getModifiers())) {
final String warningMessage = "The [" + actionName + "] action in [" +
Expand Down Expand Up @@ -846,7 +845,7 @@ protected void initializeCommandObjectParameter(final BlockStatement wrapper,
final ArgumentListExpression initializeCommandObjectArguments = args(classX(commandObjectNode), constX(paramName));
final MethodCallExpression initializeCommandObjectMethodCall = callThisX("initializeCommandObject", initializeCommandObjectArguments);
applyDefaultMethodTarget(initializeCommandObjectMethodCall, commandObjectNode);
final Expression assignCommandObjectToParameter = assignX(varX(paramName, commandObjectNode), initializeCommandObjectMethodCall);
final Expression assignCommandObjectToParameter = assignX(varX(paramName), initializeCommandObjectMethodCall);
wrapper.addStatement(stmt(assignCommandObjectToParameter));
}

Expand Down

0 comments on commit e9e20d9

Please sign in to comment.