You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/11/15 14:09:55 UTC

(commons-lang) branch master updated: Use Class instead of Class in MethodUtils

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 724d22920 Use Class<?> instead of Class<? extends Object> in MethodUtils
724d22920 is described below

commit 724d22920314964324a5676aba4285edcf58fe93
Author: Bogdan <82...@users.noreply.github.com>
AuthorDate: Sat Nov 15 06:09:50 2025 -0800

    Use Class<?> instead of Class<? extends Object> in MethodUtils
---
 src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
index 783093f9a..df6899f5a 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
@@ -287,7 +287,7 @@ public static <A extends Annotation> A getAnnotation(final Method method, final
         return annotation;
     }
 
-    private static Method getInvokeMethod(final boolean forceAccess, final String methodName, final Class<?>[] parameterTypes, final Class<? extends Object> cls) {
+    private static Method getInvokeMethod(final boolean forceAccess, final String methodName, final Class<?>[] parameterTypes, final Class<?> cls) {
         final Method method;
         if (forceAccess) {
             method = getMatchingMethod(cls, methodName, parameterTypes);
@@ -810,7 +810,7 @@ public static Object invokeMethod(final Object object, final boolean forceAccess
      */
     public static Object invokeMethod(final Object object, final boolean forceAccess, final String methodName, final Object[] args, final Class<?>[] parameterTypes)
             throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-        final Class<? extends Object> cls = Objects.requireNonNull(object, "object").getClass();
+        final Class<?> cls = Objects.requireNonNull(object, "object").getClass();
         final Class<?>[] paramTypes = ArrayUtils.nullToEmpty(parameterTypes);
         final Method method = getInvokeMethod(forceAccess, methodName, paramTypes, cls);
         requireNonNull(method, cls, methodName, paramTypes);