You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2022/01/12 15:38:31 UTC

[groovy] branch master updated (049c16d -> 72eabf2)

This is an automated email from the ASF dual-hosted git repository.

emilles pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 049c16d  GROOVY-10448: Bump gradle versions plugin to 0.41.0 (build dependency)
     new bc4f802  source range for `void` return type
     new 72eabf2  reuse sample

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java         | 4 ++--
 .../java/org/codehaus/groovy/control/messages/LocatedMessage.java     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

[groovy] 01/02: source range for `void` return type

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit bc4f802929a8000ea4e1dba327199d9f5798f985
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed Jan 12 09:37:45 2022 -0600

    source range for `void` return type
---
 src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index f22539c..690547c 100644
--- a/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -2192,11 +2192,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> {
         }
 
         if (asBoolean(ctx.VOID())) {
-            if (3 == ctx.ct) { // annotation
+            if (ctx.ct == 3) { // annotation
                 throw createParsingFailedException("annotation method cannot have void return type", ctx);
             }
 
-            return ClassHelper.VOID_TYPE.getPlainNodeReference(false);
+            return configureAST(ClassHelper.VOID_TYPE.getPlainNodeReference(false), ctx.VOID());
         }
 
         throw createParsingFailedException("Unsupported return type: " + ctx.getText(), ctx);

[groovy] 02/02: reuse sample

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 72eabf21f0cc55b13fd782e6bc57c89317cd8e42
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed Jan 12 09:38:23 2022 -0600

    reuse sample
---
 src/main/java/org/codehaus/groovy/control/messages/LocatedMessage.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/control/messages/LocatedMessage.java b/src/main/java/org/codehaus/groovy/control/messages/LocatedMessage.java
index 3f8df6b..c4ff96b 100644
--- a/src/main/java/org/codehaus/groovy/control/messages/LocatedMessage.java
+++ b/src/main/java/org/codehaus/groovy/control/messages/LocatedMessage.java
@@ -57,7 +57,7 @@ public class LocatedMessage extends SimpleMessage {
             String sample = source.getSample(line, column, janitor);
 
             if (sample != null) {
-                writer.println(source.getSample(line, column, janitor));
+                writer.println(sample);
             }
 
             writer.println(name + ": " + line + ": " + this.message);