Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following groovy file:
public class bug8 {
bug8()
static void main(String[] args)
{ def b = new bug8() }}
Produces:
Caught: java.lang.NullPointerException: Cannot invoke method plus() on null object
Without a line number for the exception, it's hard to pinpoint it. When called from Java, I get the following error message:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke method plus() on null object
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
at bug8.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at bug8j.main(bug8j.java:16)
The "Unknown Source" is the issue here.