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 2025/10/14 12:28:00 UTC

[jira] [Comment Edited] (LANG-1789) NullPointerException when generating NoSuchMethodException in MethodUtils

    [ https://issues.apache.org/jira/browse/LANG-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18029765#comment-18029765 ] 

Gary D. Gregory edited comment on LANG-1789 at 10/14/25 12:27 PM:
------------------------------------------------------------------

Hello [~hylkevds] 

You need to test with version {{{}3.20.0-SNAPSHOT{}}}. Notice the fixed version in this ticket says "3.20.0".

The GitHub CI had a random failure on Windows with Java 25.


was (Author: garydgregory):
Hello [~hylkevds] 

You need to test with version {{{}3.20.0-SNAPSHOT{}}}.

The GitHub CI had a random failure on Windows with Java 25.

> NullPointerException when generating NoSuchMethodException in MethodUtils
> -------------------------------------------------------------------------
>
>                 Key: LANG-1789
>                 URL: https://issues.apache.org/jira/browse/LANG-1789
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.19.0
>            Reporter: Hylke van der Schaaf
>            Priority: Major
>             Fix For: 3.20.0
>
>
> When calling MethodUtils.invokeMethod, on an instance that does not have the requested Method, a NoSuchMethodException should be called.
> But, when one of the parameters to be passed to the method is Null, a NullPointerException is thrown when trying to create the NoSuchMethodException.
> This is because one of the entries in the parameterTypes method is now null, and thus the call to getClass on this parameter fails.
> Trace:
> {code:java}
> Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
>     at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
>     at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
>     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
>     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
>     at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
>     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
>     at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:727)
>     at org.apache.commons.lang3.reflect.MethodUtils.requireNonNull(MethodUtils.java:1026)
>     at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:837)
>     at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:936)
>     at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:897) {code}
>  
>  



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