You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2024/11/03 16:05:00 UTC
[jira] [Updated] (LANG-1757) NullPointerException in MethodUtils.getMatchingAccessibleMethod
[ https://issues.apache.org/jira/browse/LANG-1757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated LANG-1757:
----------------------------------
Assignee: Gary D. Gregory
> 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
> Assignee: Gary D. Gregory
> Priority: Major
>
> 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)