Skip to content

Commit 46bdc23

Browse files
committed
Remove unused
org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object[], Class[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils
1 parent 482fc82 commit 46bdc23

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeMethod(Object, String, Object[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
4949
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeStaticMethod(Class, String, Object[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
5050
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeStaticMethod(Class, String, Object[], Class[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
51+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object[], Class[]) in favor of Apache Commons Lang's org.apache.commons.lang3.reflect.MethodUtils.</action>
5152
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.toNonPrimitiveClass(Class) in favor of org.apache.commons.lang3.ClassUtils.primitiveToWrapper(Class).</action>
5253
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.getPrimitiveType(Class) in favor of org.apache.commons.lang3.ClassUtils.wrapperToPrimitive(Class).</action>
5354
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove org.apache.commons.beanutils2.MethodUtils.getPrimitiveWrapper(Class) in favor of org.apache.commons.lang3.ClassUtils.primitiveToWrapper(Class).</action>

src/main/java/org/apache/commons/beanutils2/MethodUtils.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -551,41 +551,6 @@ public static Object invokeExactMethod(final Object object, final String methodN
551551
return method.invoke(object, args);
552552
}
553553

554-
/**
555-
* Invoke a static method whose parameter types match exactly the parameter types given.
556-
*
557-
* <p>
558-
* This uses reflection to invoke the method obtained from a call to {@link #getAccessibleMethod(Class, String, Class[])}.
559-
* </p>
560-
*
561-
* @param objectClass invoke static method on this class.
562-
* @param methodName get method with this name.
563-
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
564-
* {@code methodName}).
565-
* @param parameterTypes match these parameters - treat null as empty array.
566-
* @return The value returned by the invoked method.
567-
* @throws NoSuchMethodException if there is no such accessible method.
568-
* @throws InvocationTargetException wraps an exception thrown by the method invoked.
569-
* @throws IllegalAccessException if the requested method is not accessible via reflection.
570-
* @since 1.8.0
571-
*/
572-
public static Object invokeExactStaticMethod(final Class<?> objectClass, final String methodName, Object[] args, Class<?>[] parameterTypes)
573-
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
574-
if (args == null) {
575-
args = BeanUtils.EMPTY_OBJECT_ARRAY;
576-
}
577-
578-
if (parameterTypes == null) {
579-
parameterTypes = BeanUtils.EMPTY_CLASS_ARRAY;
580-
}
581-
582-
final Method method = getAccessibleMethod(objectClass, methodName, parameterTypes);
583-
if (method == null) {
584-
throw new NoSuchMethodException("No such accessible method: " + methodName + "() on class: " + objectClass.getName());
585-
}
586-
return method.invoke(null, args);
587-
}
588-
589554
/**
590555
* Invoke a named method whose parameter type matches the object type.
591556
*

0 commit comments

Comments
 (0)