getMatchingAccessibleMethod incorrectly returns null if no varargs are provided

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • 3.19.0
    • Affects Version/s: 3.18.0
    • Component/s: lang.reflect.*
    • None

      If I have a method

      String myFunc(String... args) { ... }

      and try to invoke getMatchingAccessibleMethod like this

      getMatchingAccessibleMethod(MyClass.class, "myFunc")

      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.

            Assignee:
            Unassigned
            Reporter:
            Joe Ferner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: