Skip to content

Commit a8c8e47

Browse files
committed
Remove unused
org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object[]) in favor of Apache Commons Lang's MethodUtils
1 parent c05cd84 commit a8c8e47

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

src/changes/changes.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeExactMethod(Object, String, Object) in favor of Apache Commons Lang's MethodUtils.</action>
4242
<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 MethodUtils.</action>
4343
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object) in favor of Apache Commons Lang's MethodUtils.</action>
44+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object) in favor of Apache Commons Lang's MethodUtils.</action>
45+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused org.apache.commons.beanutils2.MethodUtils.invokeExactStaticMethod(Class, String, Object[]) in favor of Apache Commons Lang's MethodUtils.</action>
4446
</release>
4547
<release version="2.0.0-M2" date="2025-05-25" description="This is a major release and requires Java 8.">
4648
<!-- FIX -->

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -681,38 +681,6 @@ public static Object invokeExactMethod(final Object object, final String methodN
681681
return method.invoke(object, args);
682682
}
683683

684-
/**
685-
* <p>
686-
* Invoke a static method whose parameter types match exactly the object types.
687-
* </p>
688-
*
689-
* <p>
690-
* This uses reflection to invoke the method obtained from a call to {@link #getAccessibleMethod(Class, String, Class[])}.
691-
* </p>
692-
*
693-
* @param objectClass invoke static method on this class
694-
* @param methodName get method with this name
695-
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
696-
* {@code methodName}).
697-
* @return The value returned by the invoked method
698-
* @throws NoSuchMethodException if there is no such accessible method
699-
* @throws InvocationTargetException wraps an exception thrown by the method invoked
700-
* @throws IllegalAccessException if the requested method is not accessible via reflection
701-
* @since 1.8.0
702-
*/
703-
public static Object invokeExactStaticMethod(final Class<?> objectClass, final String methodName, Object[] args)
704-
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
705-
if (args == null) {
706-
args = BeanUtils.EMPTY_OBJECT_ARRAY;
707-
}
708-
final int arguments = args.length;
709-
final Class<?>[] parameterTypes = new Class[arguments];
710-
for (int i = 0; i < arguments; i++) {
711-
parameterTypes[i] = args[i].getClass();
712-
}
713-
return invokeExactStaticMethod(objectClass, methodName, args, parameterTypes);
714-
}
715-
716684
/**
717685
* <p>
718686
* Invoke a static method whose parameter types match exactly the parameter types given.

0 commit comments

Comments
 (0)