Any solution for Class.getMethod() reflection and autoboxing?

后端 未结 8 1065
一向
一向 2021-02-12 22:16

I want to use

Class.getMethod(String name, Class... parameterTypes)

to find the method I need to invoke with the given parameters, but apparent

8条回答
  •  青春惊慌失措
    2021-02-12 22:58

    If you have commons-lang with version >=2.5, you can use MethodUtils.getMatchingAccessibleMethod(...) which can handle the boxing types issues.

提交回复
热议问题