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

FieldNode doesn't collect annotations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.1, 1.7.11
    • None
    • None

    Description

      It's in the test case:

      import org.codehaus.groovy.ast.ClassNode
      import java.lang.annotation.RetentionPolicy
      import java.lang.annotation.Retention
      
      
      @Retention(RetentionPolicy.RUNTIME)
      @interface Annotation1 {}
      
      @Annotation1 class A {
          @Annotation1 def field1    
      }
      
      
      new ClassNode(A).with {
          assert annotations: "ClassNode for class 'A' has an annotation as it should"
          getField('field1').with {
              assert !annotations: "Because of a bug FieldNode for field 'field1' doesn't have annotations"
          }
      }
      

      Attachments

        Activity

          People

            paulk Paul King
            mojojojo Nikita Y Volkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: