Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-beta-9
-
None
-
None
-
Any
Description
expression
new org.codehaus.groovy.runtime.MethodClosure(object,"myMethod")
never makes closure with support for variable arguments, even if myMethod is defined as:
public String myMethod(Object[] args)
{ ... }I have located the problem in Groovy source code.
In MethodClosure.java doCall is defined as:
protected Object doCall(Object arguments) {
...
}
but lang.groovy.Closure constructor turns on variable argument support only if type of last argument in doCall is Object [].
A workaround is to use expression:
new Closure(object) {
public String doCall(Object[] args)
}
Attachments
Issue Links
- is depended upon by
-
GROOVY-764 closures
- Closed