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/12/21 16:55:23 UTC

[GitHub] [groovy] eric-milles opened a new pull request #1450: GROOVY-9855: inline string concat sonner

eric-milles opened a new pull request #1450:
URL: https://github.com/apache/groovy/pull/1450


   https://issues.apache.org/jira/browse/GROOVY-9855


----------------------------------------------------------------
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



[GitHub] [groovy] eric-milles commented on a change in pull request #1450: GROOVY-9855: inline string concat sonner

Posted by GitBox <gi...@apache.org>.
eric-milles commented on a change in pull request #1450:
URL: https://github.com/apache/groovy/pull/1450#discussion_r547413422



##########
File path: src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java
##########
@@ -309,8 +309,15 @@ public static Expression transformInlineConstants(final Expression exp) {
             }
         } else if (exp instanceof BinaryExpression) {
             BinaryExpression be = (BinaryExpression) exp;
-            be.setLeftExpression(transformInlineConstants(be.getLeftExpression()));
-            be.setRightExpression(transformInlineConstants(be.getRightExpression()));
+            Expression lhs = transformInlineConstants(be.getLeftExpression());
+            Expression rhs = transformInlineConstants(be.getRightExpression());
+            if (lhs instanceof ConstantExpression && rhs instanceof ConstantExpression &&

Review comment:
       Yes, thanks.  I did have that when the code was located elsewhere.  I will get it updated.




----------------------------------------------------------------
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



[GitHub] [groovy] danielsun1106 commented on pull request #1450: GROOVY-9855: inline string concat sonner

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1450:
URL: https://github.com/apache/groovy/pull/1450#issuecomment-749841685


   +1


----------------------------------------------------------------
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



[GitHub] [groovy] danielsun1106 commented on a change in pull request #1450: GROOVY-9855: inline string concat sonner

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on a change in pull request #1450:
URL: https://github.com/apache/groovy/pull/1450#discussion_r547411442



##########
File path: src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java
##########
@@ -309,8 +309,15 @@ public static Expression transformInlineConstants(final Expression exp) {
             }
         } else if (exp instanceof BinaryExpression) {
             BinaryExpression be = (BinaryExpression) exp;
-            be.setLeftExpression(transformInlineConstants(be.getLeftExpression()));
-            be.setRightExpression(transformInlineConstants(be.getRightExpression()));
+            Expression lhs = transformInlineConstants(be.getLeftExpression());
+            Expression rhs = transformInlineConstants(be.getRightExpression());
+            if (lhs instanceof ConstantExpression && rhs instanceof ConstantExpression &&

Review comment:
       We should check `be.operation.type == Types.PLUS` too?




----------------------------------------------------------------
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



[GitHub] [groovy] danielsun1106 commented on pull request #1450: GROOVY-9855: inline string concat sonner

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1450:
URL: https://github.com/apache/groovy/pull/1450#issuecomment-750594587


   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



[GitHub] [groovy] danielsun1106 merged pull request #1450: GROOVY-9855: inline string concat sonner

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


   


----------------------------------------------------------------
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