groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <>
Subject [jira] [Closed] (GROOVY-8514) NullPointerException in class MissingMethodException
Date Thu, 26 Jul 2018 04:45:00 GMT


Paul King closed GROOVY-8514.

> NullPointerException in class MissingMethodException
> ----------------------------------------------------
>                 Key: GROOVY-8514
>                 URL:
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.14
>            Reporter: Dennis K
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 2.4.15
> The class {{MissingMethodException}} throws an {{NullPointerException}} on {{getMessage()}}
if {{arguments}} are null.
> This can happen, if the someone calls {{GroovyScriptEngineImpl.getInterface}} and invokes
a method without arguments on that interface. And the method  is not defined in the groovy
> The {{InvocationHandler}} calls the method {{invokeImpl}} with {{null}} as arguments,
because the interface method has no arguments. If the Method is not defined in the groovy
script. A {{MissingMethodException}} is thrown and catched. Than the following {{NoSuchMethodException(var5.getMessage());}}
is thrown. But {{getMessage()}} itself throws an NPE due to {{arguments}} is null.
> From the Java Documentation [InvocationHandler|]
> {quote}args - an array of objects containing the values of the arguments passed in the
method invocation on the proxy instance, or null if interface method takes no arguments. Arguments
of primitive types are wrapped in instances of the appropriate primitive wrapper class, such
as java.lang.Integer or java.lang.Boolean.
> {quote}

This message was sent by Atlassian JIRA

View raw message