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

Static block is not annotateable with @Generated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      The groovy.transform.Sortable annotation generates a static block

          static {
              Object var0 = $getCallSiteArray()[5].callConstructor(GroovySortableClassTarget.FirstComparator.class);
              this$FirstComparator = (Comparator)ScriptBytecodeAdapter.castToType(var0, Comparator.class);
              Object var1 = $getCallSiteArray()[6].callConstructor(GroovySortableClassTarget.LastComparator.class);
              this$LastComparator = (Comparator)ScriptBytecodeAdapter.castToType(var1, Comparator.class);
              Object var2 = $getCallSiteArray()[7].callConstructor(GroovySortableClassTarget.BornComparator.class);
              this$BornComparator = (Comparator)ScriptBytecodeAdapter.castToType(var2, Comparator.class);
          }
      

      This static block shows up in the jacoco report (see attached screenshot).
      It would be nice if this block would be marked as generated.
      Maybe this needs coordination with jacoco in case it is not possible to use the @Generated annotation on static blocks.

      See also GROOVY-9050

      Attachments

        1. jacoco_report.png
          40 kB
          Stephan Classen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sclassen Stephan Classen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: