Utility reflection methods focused on methods, originally from Commons BeanUtils. Differences from the BeanUtils version may be noted, especially where similar functionality already existed within Lang.
Known Limitations
Accessing Public Methods In A Default Access Superclass
There is an issue when invoking public methods contained in a default access superclass on JREs prior to 1.4. Reflection locates these methods fine and correctly assigns them as public. However, an IllegalAccessException
is thrown if the method is invoked.
MethodUtils
contains a workaround for this situation. It will attempt to call setAccessible
on this method. If this call succeeds, then the method can be invoked as normal. This call will only succeed when the application has sufficient security privileges. If this call fails then the method may fail.
@since 2.5
@version $Id: MethodUtils.java 1153241 2011-08-02 18:49:52Z ggregory $