You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/08/28 06:25:48 UTC

groovy git commit: Minor refactoring(Still use the recommended API)

Repository: groovy
Updated Branches:
  refs/heads/master 8badf9af2 -> 90c3f0be4


Minor refactoring(Still use the recommended API)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/90c3f0be
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/90c3f0be
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/90c3f0be

Branch: refs/heads/master
Commit: 90c3f0be4313b68a305e91ba6136f91403f82328
Parents: 8badf9a
Author: sunlan <su...@apache.org>
Authored: Mon Aug 28 14:25:43 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Mon Aug 28 14:25:43 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/groovy/parser/antlr4/AstBuilder.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/90c3f0be/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 00694e6..fc6d92d 100644
--- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -20,8 +20,8 @@ package org.apache.groovy.parser.antlr4;
 
 import groovy.lang.IntRange;
 import org.antlr.v4.runtime.ANTLRErrorListener;
-import org.antlr.v4.runtime.ANTLRInputStream;
 import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.CharStreams;
 import org.antlr.v4.runtime.CommonTokenStream;
 import org.antlr.v4.runtime.RecognitionException;
 import org.antlr.v4.runtime.Recognizer;
@@ -172,13 +172,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         CharStream charStream;
 
         try {
-            /*
             charStream = CharStreams.fromReader(
                     new BufferedReader(sourceUnit.getSource().getReader()),
                     sourceUnit.getName());
-            */
 
-            charStream = new ANTLRInputStream(new BufferedReader(sourceUnit.getSource().getReader()));
+            // charStream = new ANTLRInputStream(new BufferedReader(sourceUnit.getSource().getReader()));
         } catch (IOException e) {
             throw new RuntimeException("Error occurred when reading source code.", e);
         }