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

super call in invokeMethod causes a VerifyError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-5
    • None
    • None
    • linux, jdk 1.4.2, groovy 1.0-beta3 libraries, except for groovy-1.0*.jar, which I build from the CVS head today (3/3/2004)

    Description

      this fails on the last line: 'new C().duh()'

      === here is the file ===

      class A {
      invokeMethod(String name, Object args) {
      try

      { metaClass.invokeMethod(this, name, args) } catch(MissingMethodException e) {
      println "Missing method: ${name}"
      }
      }
      }
      class B extends A {
      invokeMethod(String name, Object args) {
      try { metaClass.invokeMethod(this, name, args) }

      catch(MissingMethodException e) {
      println "Missing method: ${name}"
      }
      }
      }
      class C extends A {
      invokeMethod(String name, Object args)

      { super.invokeMethod(name, args) }

      }

      new A().duh()
      new B().duh()
      new C().duh()

      === here is the error ===

      Exception in thread "main" java.lang.VerifyError: (class: C, method: invokeMethod signature: (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object Expecting to find unitialized object on stack
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:141)
      at b.class$(b.groovy)
      at b.run(b.groovy:26)
      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 groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:765)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:214)
      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 groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:765)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:214)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:98)
      at b.invokeMethod(b.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:98)
      at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:311)
      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 groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:765)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:279)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:98)
      at b.main(b.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 groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:765)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:279)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:98)
      at groovy.lang.GroovyShell.run(GroovyShell.java:171)
      at groovy.lang.GroovyShell.main(GroovyShell.java:85)
      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:461)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wburdick Bill Burdick
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: