Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-530

Cannot call static method without fully qualifying class name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • 1.0-beta-5
    • 1.0-beta-7
    • None
    • None

    Description

      I get an unexpected Exception when I do the following:

      >>> java.util.Arrays.asList(new String[]

      {"a"})
      [a]
      >>> import java.util.Arrays
      null
      >>> Arrays.asList(new String[]{"a"}

      )
      java.lang.NullPointerException: Cannot invoke method: asList on null object
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:112)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at Script16.run(Script16.groovy)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:269)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:248)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:245)
      at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:73)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at simpleshell.run(simpleshell.groovy:54)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at simpleshell.invokeMethod(simpleshell.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:332)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at simpleshell.main(simpleshell.groovy)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at groovy.lang.GroovyShell.run(GroovyShell.java:183)
      at groovy.lang.GroovyShell.main(GroovyShell.java:88)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jaquino Jonathan Aquino
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: