Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.0-JSR-2
-
None
-
None
-
WinXP, JDK1.5
Description
If I want to call a static method, I have to explicitly import the class and can not use an asterix in import.
This also happen, if the class with the static method is in the same package.
Example:
===== this does not work =======
// File: somepackage/ClassWithStaticMethod.groovy
package somepackage
class ClassWithStaticMethod {
static staticMethod() {}
}
// File: anotherpackage/ClassCallingStaticMethod.groovy
package anotherpackage
import somepackage.*
class ClassCallingStaticMethod {
def someMethod()
}
===== this works =======
package somepackage
class ClassWithStaticMethod {
static staticMethod() {}
}
package anotherpackage
import somepackage.ClassWithStaticMethod
class ClassCallingStaticMethod {
def someMethod() { ClassWithStaticMethod.staticMethod() }
}