You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by cfranzen <gi...@git.apache.org> on 2016/02/05 17:47:28 UTC

[GitHub] commons-lang pull request: LANG-1115 Add support for varargs in me...

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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---