Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.8.4
-
None
-
None
Description
http://groovy.codehaus.org/api/groovy/lang/MetaObjectProtocol.html#getMetaMethod(java.lang.String, java.lang.Object[])
—
The args parameter is described as "The argument types", but the method definition says "Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod".
For the former, I'd expect to pass in something like [String.class]; from the latter I'd expect to have to pass in [""]
—
The code actually works with both!
Looks like it eventually calls MetaClassHelper.castArgumentsToClassArray, which uses the arg if it's a Class, or uses argType.getClass() otherwise.
If this is guaranteed to be the case in future version, then I'd suggest the wording:
@param args The argument types: can be the Class objects, or example argument values for inferring the types