[ 
https://issues.apache.org/jira/browse/GROOVY-8514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-8514.
-----------------------------

> NullPointerException in class MissingMethodException
> ----------------------------------------------------
>
>                 Key: GROOVY-8514
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8514
>             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 script.
> 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|https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html]
> {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
(v7.6.3#76005)

Reply via email to