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

Invalid class generated for an annotation when @Grab is used with it.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.2, 1.8-beta-1
    • 1.7.2, 1.8-beta-1
    • None
    • None

    Description

      @Grab(group='commons-primitives', module='commons-primitives', version='1.0')
      import java.lang.annotation.*
      
      @Retention(RetentionPolicy.RUNTIME)
      @interface Require {
          String value()
      }
      

      The code above produces a class that is invalid and whose loading fails with the error below:

      Caught: java.lang.VerifyError: (class: Require, method: <clinit> signature: ()V) Empty code
      

      It seems that the static initializer method (<clinit>) gets written in bytecode without its body.

      Attachments

        Issue Links

          Activity

            People

              roshandawrani Roshan Dawrani
              roshandawrani Roshan Dawrani
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: