groovy
  1. groovy
  2. GROOVY-4065

groovyc not compiling correctly when Grape.grab is used

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0, 2.2.0-beta-1
    • Fix Version/s: 2.2.0-rc-1
    • Component/s: Compiler, Grape
    • Labels:
      None
    • Environment:
      osx 10.6 / JVM: 1.6.0_17
    • Number of attachments :
      0

      Description

      This is my first Jira on codehaus. Please let me know if I'm filing this the right way. Thank You!

      Example class Foo:

      import groovy.grape.*
      class Foo {
        public static void main(String[] args){
          Grape.grab(group:'org.apache.ant', module:'ant', version:'1.8.0');
          System.out.println("Grape.grab seems to work");
        }
      }
      

      Compilation:

      > groovy Foo.groovy 
      Grape.grab seems to work
      
      > groovyc Foo.groovy 
      
      > java -cp $PATH:/opt/groovy/embeddable/groovy-all-1.7.0.jar:ivy-2.1.0.jar:. Foo 
      Exception in thread "main" java.lang.NullPointerException: Cannot invoke method removeAll() on null object
      	at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
      	at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:17)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      	at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:241)
      	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:597)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)
      	at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:216)
      	at groovy.grape.Grape.grab(Grape.java:131)
      	at groovy.grape.Grape$grab.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      	at Foo.main(Foo.groovy:4)
      

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Matt M.
          • Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: