You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/01/16 02:33:34 UTC

[GitHub] [groovy] blindpirate opened a new pull request #1141: Refine some code

blindpirate opened a new pull request #1141: Refine some code
URL: https://github.com/apache/groovy/pull/1141
 
 
   Found some bad code when running analysis.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] blindpirate commented on a change in pull request #1141: Refine some code

Posted by GitBox <gi...@apache.org>.
blindpirate commented on a change in pull request #1141: Refine some code
URL: https://github.com/apache/groovy/pull/1141#discussion_r367206200
 
 

 ##########
 File path: src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java
 ##########
 @@ -74,7 +74,7 @@ public static ConstantExpression transformBinaryConstantExpression(final BinaryE
                 Expression left = transformInlineConstants(be.getLeftExpression(), targetType);
                 Expression right = transformInlineConstants(be.getRightExpression(), targetType);
                 if (left instanceof ConstantExpression && right instanceof ConstantExpression) {
-                    return configure(be, new ConstantExpression((String) ((ConstantExpression) left).getValue() + ((ConstantExpression) right).getValue()));
+                    return configure(be, new ConstantExpression(((ConstantExpression) left).getValue() + ((ConstantExpression) right).getValue()));
 
 Review comment:
   Haha, you're so fast.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] danielsun1106 commented on issue #1141: Refine some code

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on issue #1141: Refine some code
URL: https://github.com/apache/groovy/pull/1141#issuecomment-575031688
 
 
   Merged. Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] danielsun1106 merged pull request #1141: Refine some code

Posted by GitBox <gi...@apache.org>.
danielsun1106 merged pull request #1141: Refine some code
URL: https://github.com/apache/groovy/pull/1141
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] danielsun1106 commented on a change in pull request #1141: Refine some code

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on a change in pull request #1141: Refine some code
URL: https://github.com/apache/groovy/pull/1141#discussion_r367206102
 
 

 ##########
 File path: src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java
 ##########
 @@ -74,7 +74,7 @@ public static ConstantExpression transformBinaryConstantExpression(final BinaryE
                 Expression left = transformInlineConstants(be.getLeftExpression(), targetType);
                 Expression right = transformInlineConstants(be.getRightExpression(), targetType);
                 if (left instanceof ConstantExpression && right instanceof ConstantExpression) {
-                    return configure(be, new ConstantExpression((String) ((ConstantExpression) left).getValue() + ((ConstantExpression) right).getValue()));
+                    return configure(be, new ConstantExpression(((ConstantExpression) left).getValue() + ((ConstantExpression) right).getValue()));
 
 Review comment:
   This may cause compilation error ;-)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services