groovy
  1. groovy
  2. GROOVY-4952

VerifyError - Virtual method call from a static context

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0, 1.8.1
    • Fix Version/s: 1.8.2, 1.9-beta-3
    • Component/s: bytecode, Compiler
    • Labels:
      None
    • Environment:
      Mac - JDK 1.6.0_22
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      Failing to put a public accessor on the 'name' field of the attached test object causes an error in the bytecode.

      The exception is:
      <error message="(class: com/peersaver/model/Breaking, method: <clinit> signature: ()V) Incompatible object argument for function call" type="java.lang.VerifyError">java.lang.VerifyError: (class: com/peersaver/model/Breaking, method: <clinit> signature: ()V) Incompatible object argument for function call
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at com.peersaver.model.BreakingTest.class$(BreakingTest.groovy)
      at com.peersaver.model.BreakingTest.$get$$class$com$peersaver$model$Breaking(BreakingTest.groovy)
      at com.peersaver.model.BreakingTest.testBreaking(BreakingTest.groovy:23)
      </error>

      The email conversation with details is here:
      http://groovy.329449.n5.nabble.com/VerifyError-when-upgrading-to-Groovy-1-8-1-clinit-problem-around-getter-generation-td4640586.html

      The relevant bit, again quoting BlackDragon:
      (in the <clinit> bytecode)
      "> ALOAD 0
      > INVOKEVIRTUAL Quiz.getName() : String
      > INVOKEINTERFACE CallSite.call(Object,Object) : Object

      it is a pretty bad idea to do a virtual method call from a static
      context. Looks like that information is missed on "

        Activity

        Hide
        blackdrag blackdrag added a comment -

        fixed

        Show
        blackdrag blackdrag added a comment - fixed

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Jason Griffith
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: