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

Unable to use increment operator on static variables prefixed by class name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.5.6, 1.6-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      Cannot use increment operator on static variables when prefixed by class name. For instance (++counter) works fine but (++ClassName.counter) does not. This is a runtime, not compile time issue.

      The exception that is reported is:

      java.lang.VerifyError: (class: StaticIncrementBug, method: main signature: 
      ([Ljava/lang/String;)V) Unable to pop operand off an empty stack.
      

      It looks like incorrect byte code which is corrupting the stack. That's just a guess, I don't know enough about groovy internals to fix it.

        Attachments

        1. StaticIncrementBug.groovy
          0.2 kB
          David Clark

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              davidclark David Clark
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: