[ 
https://issues.apache.org/jira/browse/LANG-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014243#comment-18014243
 ] 

Seungyong Hong edited comment on LANG-1782 at 8/17/25 5:01 AM:
---------------------------------------------------------------

 

 

Hi [~joeferner], I'm interesting in this issue.

 

I can only reproduce it when class that has method wants to get via 
'getMatchingAccessibleMethod' is private modifier.

-> It seems normal  behavior.

 

Can you provide example code?


was (Author: JIRAUSER310736):
 

Hi, I'm interesting in this issue.

 

I can only reproduce it when class that has method wants to get via 
'getMatchingAccessibleMethod' is private modifier.

-> It seems normal  behavior.

 

Can you provide example code?

> getMatchingAccessibleMethod incorrectly returns null if no varargs are 
> provided
> -------------------------------------------------------------------------------
>
>                 Key: LANG-1782
>                 URL: https://issues.apache.org/jira/browse/LANG-1782
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.18.0
>            Reporter: Joe Ferner
>            Priority: Major
>
> If I have a method
> {code:java}
> String myFunc(String... args) { ... }{code}
> and try to invoke getMatchingAccessibleMethod like this
> {code:java}
> getMatchingAccessibleMethod(MyClass.class, "myFunc"){code}
> the expected return would be myFunc but instead null is received. This 
> happens because 
> [https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java#L336]
>  incorrectly assumes at least one vararg type is passed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to