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)
}
}
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 @@
}
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() {