Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.7, 2.2.1
-
None
Description
As of groovy 2.1.7, a static method is not found when it is called from within a closure in a child class.
Example:
class Superclass { static SuperclassStaticMethod() { return "A" } } class Closureclass extends Superclass { static closuremethod = { return "B" + SuperclassStaticMethod() // this should be found } } assert Closureclass.closuremethod() == "BA"
Before groovy 2.1.7, this would work fine. As of groovy 2.1.7, including 2.2.1, this will result in a:
groovy.lang.MissingMethodException: No signature of method: Closureclass$_clinit_closure1.SuperclassStaticMethod() is applicable for argument types: () values: []
at Closureclass$_clinit_closure1.doCall(closureSimple.groovy:9)
at Closureclass$_clinit_closure1.doCall(closureSimple.groovy)
at closureSimple.run(closureSimple.groovy:13)
I suspect https://jira.codehaus.org/browse/GROOVY-5261 (Fix Version/s: 2.1.7, 2.2.0-beta-2) may be a cause.