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/02/01 06:45:15 UTC

[GitHub] [groovy] Ten000hours opened a new pull request #1156: refact some code into java 8 style

Ten000hours opened a new pull request #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156
 
 
   Just refactor some code into Java 8 style.

----------------------------------------------------------------
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] paulk-asert commented on a change in pull request #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#discussion_r373824955
 
 

 ##########
 File path: src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java
 ##########
 @@ -35,13 +35,7 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
 Review comment:
   we tend to avoid star imports

----------------------------------------------------------------
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] Ten000hours commented on issue #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
Ten000hours commented on issue #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#issuecomment-581139803
 
 
   Cheers! Thanks for y'all efforts.

----------------------------------------------------------------
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 #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on issue #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#issuecomment-581098787
 
 
   Could you squash the commits?

----------------------------------------------------------------
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 #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on issue #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#issuecomment-581022573
 
 
   > I think the errors on CI are caused by this change.
   
   Agreed.
   

----------------------------------------------------------------
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] asfgit closed pull request #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156
 
 
   

----------------------------------------------------------------
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] paulk-asert commented on a change in pull request #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#discussion_r373824993
 
 

 ##########
 File path: src/main/java/org/codehaus/groovy/antlr/Main.java
 ##########
 @@ -47,25 +47,33 @@ public static void main(String[] args) {
 
                 // for each directory/file specified on the command line
                 for (String arg : args) {
-                    if (arg.equals("-showtree")) {
-                        showTree = true;
-                    }
-                    //else if ( args[i].equals("-xml") ) {
-                    //    xml = true;
-                    //}
-                    else if (arg.equals("-verbose")) {
-                        verbose = true;
-                    } else if (arg.equals("-trace")) {
-                        GroovyRecognizer.tracing = true;
-                        GroovyLexer.tracing = true;
-                    } else if (arg.equals("-traceParser")) {
-                        GroovyRecognizer.tracing = true;
-                    } else if (arg.equals("-traceLexer")) {
-                        GroovyLexer.tracing = true;
-                    } else if (arg.equals("-whitespaceIncluded")) {
-                        whitespaceIncluded = true;
-                    } else {
-                        doFile(new File(arg)); // parse it
+                    switch (arg) {
+                        case "-showtree":
+                            showTree = true;
+                            break;
+                        //else if ( args[i].equals("-xml") ) {
+                        //    xml = true;
+                        //}
+                        case "-verbose":
+                            verbose = true;
+                            break;
+                        case "-trace":
+                            GroovyRecognizer.tracing = true;
+                            GroovyLexer.tracing = true;
+                            break;
+                        case "-traceParser":
+                            GroovyRecognizer.tracing = true;
+                            break;
+                        case "-traceLexer":
+                            GroovyLexer.tracing = true;
+                            break;
+                        case "-whitespaceIncluded":
+                            whitespaceIncluded = true;
+                            break;
+                        default:
+                            doFile(new File(arg)); // parse it
+
+                            break;
                     }
 
 Review comment:
   this file will likely be removed in Groovy 4, so this would be a 3 only change

----------------------------------------------------------------
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] paulk-asert commented on issue #1156: refact some code into java 8 style

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on issue #1156: refact some code into java 8 style
URL: https://github.com/apache/groovy/pull/1156#issuecomment-581112490
 
 
   Merged with minor changes (as per my comments). 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