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

last enum value is hidden if annotated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.10, 2.4.1
    • 2.4.6
    • None
    • None
    • Windows 7
      First seen in Eclipse Luna (which also doesn't syntax highlight it well)

    Description

      When I annotate the final enum value in an enum, the enum value is no longer part of the enum, eg, running this via GroovyShell throws MissingPropertyException on the last line:

      @Target([ElementType.FIELD])
      @interface Fooann {
      }
      
      enum Foonum {
          @Fooann
          X,
          @Fooann // all is well if either (a) this annotation is removed,
          Y       // or (b) this value has a trailing comma
      }
      
      class Bar {
          Foonum foonum
      }
      
      println Foonum.X
      println Foonum.Y
      

      Attachments

        1. bug1.groovy
          1.0 kB
          simon misys

        Issue Links

          Activity

            People

              shils Shil Sinha
              marshals simon misys
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: