[
https://issues.apache.org/jira/browse/GROOVY-3548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles closed GROOVY-3548.
-------------------------------
Resolution: Information Provided
> Method call on instance of java.lang.Class is dispatched to equally named
> static method on class described by instance
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-3548
> URL: https://issues.apache.org/jira/browse/GROOVY-3548
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 1.6.3, 2.4.0-rc-1
> Reporter: Peter Niederwieser
> Priority: Major
>
> {code}
> 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" }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)