[ 
https://issues.apache.org/jira/browse/GROOVY-5876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pascal Schumacher closed GROOVY-5876.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.0

Closing this issue based on Jeffs comment. Thanks Jeff.

> Problem With Arguments Passed To Static Dynamic Methods
> -------------------------------------------------------
>
>                 Key: GROOVY-5876
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5876
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 1.8.8
>            Reporter: Jeff Brown
>             Fix For: 2.4.0
>
>
> If I do something like this...
> {noformat}
> String.metaClass.doSomething = { Object[] args ->
>     println args.length
> }
> 'Scott Gorham'.doSomething(1, 2, 3)
> {noformat}
> args.length is 3, which is what I would expect. 
> If I do something like this...
> {noformat}
> String.metaClass.static.doSomething = { Object[] args ->
>     println args.length
>     println args[0].length
> }
> String.doSomething(1, 2, 3)
> {noformat}
> Then args.length is 1 and args[0].length is 3.  The array that contains the 
> actual arguments (1, 2, 3) is being wrapped inside of another array.
> The instance method is behaving the way I would expect.  The static method is 
> not.  It seems like these should behave the same with respect to this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to