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

STC: fix support for unbounded wildcard references to self-bounded type parameters

    XMLWordPrintableJSON

Details

    Description

      @Grab('org.springframework.boot:spring-boot-starter-webflux:2.6.7')
      import org.springframework.core.ParameterizedTypeReference
      import org.springframework.http.MediaType
      import org.springframework.web.reactive.function.client.WebClient
      
      import java.time.Duration
      
      @groovy.transform.CompileStatic
      class WebFluxFluentApiBugTest {
      
        private static final ParameterizedTypeReference<List<BigDecimal>> TYPE_TAG
          = new ParameterizedTypeReference<List<BigDecimal>>() {}
      
        private static final Duration MAX_DURATION = Duration.ofSeconds(8)
      
        private final WebClient webClient
      
        List<BigDecimal> flux() {
          def response = webClient.get()
            .uri('/something?id={id}', 'id')
            .accept(MediaType.APPLICATION_JSON)
            .retrieve()
            .toEntity(TYPE_TAG)
            .block(MAX_DURATION)
          return response.getBody() ?: []
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: