@@ -753,9 +753,8 @@ protected void initializeAndValidateCommandObjectParameter(final BlockStatement
753753 final ClassNode controllerNode , final ClassNode commandObjectNode ,
754754 final ASTNode actionNode , final String actionName , final String paramName ,
755755 final SourceUnit source , final GeneratorContext context ) {
756- final DeclarationExpression declareCoExpression = new DeclarationExpression (
757- new VariableExpression (paramName , commandObjectNode ), Token .newSymbol (Types .EQUALS , 0 , 0 ), new EmptyExpression ());
758- wrapper .addStatement (new ExpressionStatement (declareCoExpression ));
756+ final DeclarationExpression declareCoExpression = declX (localVarX (paramName , commandObjectNode ), new EmptyExpression ());
757+ wrapper .addStatement (stmt (declareCoExpression ));
759758
760759 if (commandObjectNode .isInterface () || Modifier .isAbstract (commandObjectNode .getModifiers ())) {
761760 final String warningMessage = "The [" + actionName + "] action in [" +
@@ -846,7 +845,7 @@ protected void initializeCommandObjectParameter(final BlockStatement wrapper,
846845 final ArgumentListExpression initializeCommandObjectArguments = args (classX (commandObjectNode ), constX (paramName ));
847846 final MethodCallExpression initializeCommandObjectMethodCall = callThisX ("initializeCommandObject" , initializeCommandObjectArguments );
848847 applyDefaultMethodTarget (initializeCommandObjectMethodCall , commandObjectNode );
849- final Expression assignCommandObjectToParameter = assignX (varX (paramName , commandObjectNode ), initializeCommandObjectMethodCall );
848+ final Expression assignCommandObjectToParameter = assignX (varX (paramName ), initializeCommandObjectMethodCall );
850849 wrapper .addStatement (stmt (assignCommandObjectToParameter ));
851850 }
852851
0 commit comments