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 2019/12/07 20:40:03 UTC

[groovy] branch master updated: Don't transfer import source ranges to static properties or method calls

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


The following commit(s) were added to refs/heads/master by this push:
     new e4dbbae  Don't transfer import source ranges to static properties or method calls
e4dbbae is described below

commit e4dbbae65caa277fa0aca289e2863b9c9214be82
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Sat Dec 7 14:19:25 2019 -0600

    Don't transfer import source ranges to static properties or method calls
    
    https://github.com/groovy/groovy-eclipse/issues/727
    
    import static Foo.getSomeThing as something
    @groovy.transform.CompileStatic
    class Bar {
      def baz(x, y) {
        something(x, y) // includes "Foo" (line 1, column 14)
      }
    }
---
 src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java b/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
index e8557a7..1dea516 100644
--- a/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
@@ -558,11 +558,11 @@ public class StaticImportVisitor extends ClassCodeExpressionTransformer {
     }
 
     private static PropertyExpression newStaticPropertyX(ClassNode type, String name) {
-        return new PropertyExpression(new ClassExpression(type), name);
+        return new PropertyExpression(new ClassExpression(type.getPlainNodeReference()), name);
     }
 
     private static StaticMethodCallExpression newStaticMethodCallX(ClassNode type, String name, Expression args) {
-        return new StaticMethodCallExpression(type, name, args);
+        return new StaticMethodCallExpression(type.getPlainNodeReference(), name, args);
     }
 
     protected SourceUnit getSourceUnit() {