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

JSR308 info incomplete in bytecode

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-3
    • None

    Description

      For this Java code:

      import net.jqwik.api.ForAll;
      import net.jqwik.api.Property;
      import net.jqwik.api.constraints.IntRange;
      
      import java.util.List;
      
      public class Jsr308J {
          @Property
          public boolean sizeZeroOrPositive(
                  @ForAll List<@IntRange(min=0, max=10) Integer> items
          ) {
              return items.size() >= 0;
          }
      }
      

      bytecode for method contains this info:

          RuntimeVisibleAnnotations:
            0: #22()
          RuntimeVisibleTypeAnnotations:
            0: #24(#25=I#26,#27=I#28): METHOD_FORMAL_PARAMETER, param_index=0, location=[TYPE_ARGUMENT(0)]
          RuntimeVisibleParameterAnnotations:
            parameter 0:
              0: #30()
      

      For this Groovy code,

      //@Grab('net.jqwik:jqwik:1.1.4')
      import groovy.transform.CompileStatic
      import net.jqwik.api.ForAll
      import net.jqwik.api.Property
      import net.jqwik.api.constraints.IntRange;
      
      @CompileStatic
      class Jsr308 {
          @Property
          boolean 'size zero or positive'(
                  @ForAll List<@IntRange(min=0, max=10) Integer> items
          ) {
              items.size() >= 0
          }
      }
      

      Respective bytecode info is:

          RuntimeVisibleAnnotations:
            0: #31()
          RuntimeVisibleParameterAnnotations:
            parameter 0:
              0: #32()
      

      It is missing the RuntimeVisibleTypeAnnotations information.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment