Skip to content

Commit c05cd84

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

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove unused ConstructorUtils in favor of Apache Commons Lang's ConstructorUtils. ConstructorUtils is unused in this component.</action>
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>
43+
<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>
4344
</release>
4445
<release version="2.0.0-M2" date="2025-05-25" description="This is a major release and requires Java 8.">
4546
<!-- FIX -->

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -681,30 +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 type matches exactly the object type.
687-
* </p>
688-
*
689-
* <p>
690-
* This is a convenient wrapper for {@link #invokeExactStaticMethod(Class objectClass,String methodName,Object [] args)}.
691-
* </p>
692-
*
693-
* @param objectClass invoke static method on this class
694-
* @param methodName get method with this name
695-
* @param arg use this argument. May be null (this will result in calling the parameterless method with name {@code methodName}).
696-
* @return The value returned by the invoked method
697-
* @throws NoSuchMethodException if there is no such accessible method
698-
* @throws InvocationTargetException wraps an exception thrown by the method invoked
699-
* @throws IllegalAccessException if the requested method is not accessible via reflection
700-
* @since 1.8.0
701-
*/
702-
public static Object invokeExactStaticMethod(final Class<?> objectClass, final String methodName, final Object arg)
703-
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
704-
final Object[] args = toArray(arg);
705-
return invokeExactStaticMethod(objectClass, methodName, args);
706-
}
707-
708684
/**
709685
* <p>
710686
* Invoke a static method whose parameter types match exactly the object types.

src/test/java/org/apache/commons/beanutils2/MethodUtilsTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@ void testInvokeExactMethodNullArrayNullArray() throws Exception {
113113
assertEquals("parent", result);
114114
}
115115

116-
@Test
117-
void testInvokeExactStaticMethodNull() throws Exception {
118-
final int current = TestBean.currentCounter();
119-
final Object value = MethodUtils.invokeExactStaticMethod(TestBean.class, "currentCounter", (Object) null);
120-
assertEquals(current, ((Integer) value).intValue(), "currentCounter value");
121-
}
122-
123116
/**
124117
* <p>
125118
* Test {@code invokeMethod}.

0 commit comments

Comments
 (0)