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

Exception thrown in groovyConsole

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.4
    • 2.2.0-beta-1
    • Groovy Console
    • None

    Description

      Add the following snippet to an empty groovyConsole using Groovy 2.0.4:

      package pkg1
      
      import groovy.transform.TypeChecked
      
      
      class ExtendedList extends ArrayList<String>{    
      }
      
      class SourceClass {
          @TypeChecked public static ExtendedList createList() { 
              return null; 
          }
      }
      

      Compile and then you get the following exception:

      Exception thrown
      Nov 16, 2012 9:21:19 AM org.codehaus.groovy.runtime.StackTraceUtils sanitize
      WARNING: Sanitizing stacktrace:
      java.lang.IllegalArgumentException: argument type mismatch
      	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.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2402)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3330)
      	at org.codehaus.groovy.runtime.InvokerHelper.setProperties(InvokerHelper.java:463)
      	at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:440)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:625)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:652)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:643)
      	at groovy.lang.GroovyShell$parse.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      	at groovy.ui.Console$_compileScript_closure18.doCall(Console.groovy:997)
      	at groovy.ui.Console$_compileScript_closure18.doCall(Console.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:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:904)
      	at groovy.lang.Closure.call(Closure.java:415)
      	at groovy.lang.Closure.call(Closure.java:409)
      	at groovy.lang.Closure.run(Closure.java:493)
      	at java.lang.Thread.run(Thread.java:680)
      
      java.lang.IllegalArgumentException: argument type mismatch
      

      Attachments

        Activity

          People

            paulk Paul King
            werdna Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: