groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: backport the implementation
Date Sat, 24 Jun 2017 06:12:53 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X a20d6ef1b -> e828fae28


backport the implementation


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

Branch: refs/heads/GROOVY_2_6_X
Commit: e828fae28c46b6e6c2a49c23bc7102baa0633ccb
Parents: a20d6ef
Author: sunlan <sunlan@apache.org>
Authored: Sat Jun 24 14:12:44 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Sat Jun 24 14:12:44 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/groovy/parser/antlr4/AstBuilder.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e828fae2/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 ffbc012..7f82ff5 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
@@ -2788,7 +2788,9 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
 
                 if (asBoolean(emptyDimList)) {
                     empties = new Expression[emptyDimList.size()];
-                    Arrays.setAll(empties, i -> ConstantExpression.EMPTY_EXPRESSION);
+                    for (int i = 0; i < empties.length; ++i) {
+                        empties[i] = ConstantExpression.EMPTY_EXPRESSION;
+                    }
                 } else {
                     empties = new Expression[0];
                 }
@@ -2807,8 +2809,10 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
                                 null,
                                 sizes);
 
-
-                List<List<AnnotationNode>> exprDimList = ctx.annotationsOpt().stream().map(this::visitAnnotationsOpt).collect(Collectors.toList());
+                List<List<AnnotationNode>> exprDimList = new ArrayList<List<AnnotationNode>>();
+                for (AnnotationsOptContext annotationsOptContext : ctx.annotationsOpt())
{
+                    exprDimList.add(this.visitAnnotationsOpt(annotationsOptContext));
+                }
                 allDimList = new ArrayList<>(exprDimList);
                 Collections.reverse(emptyDimList);
                 allDimList.addAll(emptyDimList);


Mime
View raw message