[
https://issues.apache.org/jira/browse/LANG-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134440#comment-15134440
]
ASF GitHub Bot commented on LANG-1115:
--------------------------------------
Github user cfranzen commented on the pull request:
https://github.com/apache/commons-lang/pull/89#issuecomment-180435170
I have played around a little bit with that pull request here and I think I
have found an issue with the current implementation. When building the varArgs
array that will be used in method.invoke() the method System.arraycopy() is
used. Unfortunately this method will not handle auto-(un)boxing correctly. So
the following example will not work:
```java
class TestBean{
public void doSomething(int... values){
...
}
}
MethodUtils.invokeMethod(testBean, Integer.valueOf(1), Integer.valueOf(2));
```
My expectation would be that MethodUtils is able to handle that. Not sure
if my expectation is wrong.
> Add support for varargs in ConstructorUtils, MemberUtils, and MethodUtils
> -------------------------------------------------------------------------
>
> Key: LANG-1115
> URL: https://issues.apache.org/jira/browse/LANG-1115
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.reflect.*
> Reporter: Joe Ferner
> Assignee: Benedikt Ritter
> Priority: Minor
> Fix For: Review Patch, 3.5
>
> Attachments: LANG-1115.patch
>
>
> Currently when calling methods such as
> MethodUtils.getMatchingAccessibleMethod variable arguments are not supported.
> It would be nice if by calling getMatchingAccessibleMethod with arguments
> that the java compiler would normally match with a vararg method would be
> matched.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)