Skip to content

Commit 7a73349

Browse files
committed
Remove org.apache.commons.beanutils2.MethodUtils.getAccessibleMethod(Class,
String, Class) in favor vararg variant
1 parent 9b0823d commit 7a73349

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

src/changes/changes.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
<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>
5151
<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>
5252
<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>
53-
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove org.apache.commons.beanutils2.MethodUtils.isAssignmentCompatible(Class toClass, Class cls) in favor oforg.apache.commons.lang3.ClassUtils.isAssignable(Class cls, Class toClass).</action>
53+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove org.apache.commons.beanutils2.MethodUtils.isAssignmentCompatible(Class toClass, Class cls) in favor of org.apache.commons.lang3.ClassUtils.isAssignable(Class cls, Class toClass).</action>
54+
<action dev="ggregory" type="remove" due-to="Gary Gregory">Remove org.apache.commons.beanutils2.MethodUtils.getAccessibleMethod(Class, String, Class) in favor vararg variant.</action>
5455
</release>
5556
<release version="2.0.0-M2" date="2025-05-25" description="This is a major release and requires Java 8.">
5657
<!-- FIX -->

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,6 @@ public static Method getAccessibleMethod(Class<?> clazz, Method method) {
208208
return method;
209209
}
210210

211-
/**
212-
* <p>
213-
* Return an accessible method (that is, one that can be invoked via reflection) with given name and a single parameter. If no such method can be found,
214-
* return {@code null}. Basically, a convenience wrapper that constructs a {@code Class} array for you.
215-
* </p>
216-
*
217-
* @param clazz get method from this class
218-
* @param methodName get method with this name
219-
* @param parameterType taking this type of parameter
220-
* @return The accessible method
221-
*/
222-
public static Method getAccessibleMethod(final Class<?> clazz, final String methodName, final Class<?> parameterType) {
223-
final Class<?>[] parameterTypes = { parameterType };
224-
return getAccessibleMethod(clazz, methodName, parameterTypes);
225-
}
226-
227211
/**
228212
* <p>
229213
* Return an accessible method (that is, one that can be invoked via reflection) with given name and parameters. If no such method can be found, return
@@ -235,7 +219,7 @@ public static Method getAccessibleMethod(final Class<?> clazz, final String meth
235219
* @param parameterTypes with these parameters types
236220
* @return The accessible method
237221
*/
238-
public static Method getAccessibleMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes) {
222+
public static Method getAccessibleMethod(final Class<?> clazz, final String methodName, final Class<?>... parameterTypes) {
239223
try {
240224
final MethodDescriptor md = new MethodDescriptor(clazz, methodName, parameterTypes, true);
241225
// Check the cache first

0 commit comments

Comments
 (0)