Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 594c1d26d -> 696d42c91


Fix the test groovy.ui.GroovyMainTest.testURISource

(cherry picked from commit bbe543d)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 696d42c91e0c6c80c9d154a1e279b2c69507e67f
Parents: 594c1d2
Author: sunlan <sun...@apache.org>
Authored: Mon Aug 7 00:51:19 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Mon Aug 7 00:52:06 2017 +0800

----------------------------------------------------------------------
 .../org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/696d42c9/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
----------------------------------------------------------------------
diff --git 
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
 
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
index 31ad35f..0b4728f 100644
--- 
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
+++ 
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
@@ -52,8 +52,13 @@ public class Antlr4ParserPlugin implements ParserPlugin {
     }
 
     @Override
-    public ModuleNode buildAST(SourceUnit sourceUnit, java.lang.ClassLoader 
classLoader, Reduction cst) throws ParserException {
-        if (null != this.readerSource) {
+    public ModuleNode buildAST(SourceUnit sourceUnit, ClassLoader classLoader, 
Reduction cst) throws ParserException {
+        try {
+            ReaderSource readerSource = sourceUnit.getSource();
+            if (null == readerSource || null == readerSource.getReader()) {
+                sourceUnit.setSource(this.readerSource);
+            }
+        } catch (IOException e) {
             sourceUnit.setSource(this.readerSource);
         }
 

Reply via email to