Details
Description
class JavaLangClassUsageTest extends GroovyTestCase { void testCallFooGetNameMethod() { assert Foo.getName() == "Foo.getName" // passes } void testCallJavaLangClassGetNameMethod() { def clazz = new Foo().getClass() assert clazz.getName() == "Foo" // fails, actual: Foo.getName } } class Foo { static getName() { "Foo.getName" } }
Issue Links
- is related to
-
GROOVY-3549
Usage of ".class" to disambiguate between methods
-
Activity
Peter Niederwieser
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Link | This issue is related to GROOVY-3549 [ GROOVY-3549 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Fix Version/s | 1.7-beta-x [ 15538 ] |
blackdrag blackdrag
made changes -
| Assignee | Jochen Theodorou [ blackdrag ] |
blackdrag blackdrag
made changes -
| Assignee | Jochen Theodorou [ blackdrag ] | Paul King [ paulk ] |
Paul King
made changes -
| Assignee | Paul King [ paulk ] |
blackdrag blackdrag
made changes -
| Fix Version/s | 1.8.x [ 15750 ] | |
| Fix Version/s | 2.x [ 17013 ] | |
| Fix Version/s | 1.7.x [ 15538 ] |
Paul I found some code in StaticImportVisitor that may cause this issue here. It is changing a MethodCallExpression with a ClassExpression as receiver into a StaticMethodCallExpression and in the act it changes the receiver to the current class, which may not be what the ClassExpression is refering to.