[ https://issues.apache.org/jira/browse/LANG-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014612#comment-18014612 ]
Joe Ferner commented on LANG-1782: ---------------------------------- Before this [PR|https://github.com/apache/commons-lang/pull/1427] this [line|https://github.com/apache/commons-lang/pull/1427/files#diff-8be3da3527a6f573d4d7202622638ca391209d1709b767512adb679ba093c3acR1017] would fail > 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)