Magnus Madsen created LANG-1757:
-----------------------------------

             Summary: NullPointerException in 
MethodUtils.getMatchingAccessibleMethod
                 Key: LANG-1757
                 URL: https://issues.apache.org/jira/browse/LANG-1757
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.reflect.*
    Affects Versions: 3.17.0
            Reporter: Magnus Madsen


Hello devs,

Calling MethodUtils.getMatchingAccessibleMethod with the arguments:
 *  cls is the class of `java.nio.file.Files`
 * methodName is the string `exists`
 * parameterTypes is an array with the class of `java.nio.file.Path`

triggers a NullPointerException:

{code:java}
Cannot invoke "java.lang.Class.getName()" because the return value of 
"java.lang.Class.getSuperclass()" is null
    at 
org.apache.commons.lang3.reflect.MethodUtils.getMatchingAccessibleMethod(MethodUtils.java:354)
{code}

I suspect it is this line: 
https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java#L352
 that is buggy

In particular, I suspect the problem is that `java.nio.file.Path` is an 
interface which lacks a super class. 

I am happy to provide more information if needed.

Thanks for making this library. It has been very useful to us.
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to