Skip to content

Commit

Permalink
Add file with implicit call to blocking method (quarkus-qe#1941)
Browse files Browse the repository at this point in the history
Reproducer for this fix: quarkusio/quarkus#40721

(cherry picked from commit a2f4bc1)
  • Loading branch information
fedinskiy authored and jedla97 committed Sep 3, 2024
1 parent 5986dff commit 7d0b4dd
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.redhat; // this bug can not be reproduced for classes in io.quarkus package

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import io.quarkus.rest.client.reactive.ClientExceptionMapper;
import io.smallrye.common.annotation.Blocking;

/**
* Reproducer for compilation failure
* See https://github.com/quarkusio/quarkus/issues/38275#issuecomment-2115117993
*/
@RegisterRestClient
public interface BrokenBlockingApi {
@GET
@Path("/")
String request();

@Blocking
@ClientExceptionMapper
static RuntimeException toException(Response response) {
String entity = response.readEntity(String.class).isEmpty()
? response.getStatusInfo().getReasonPhrase()
: response.readEntity(String.class);
return new RuntimeException(entity);
}
}

0 comments on commit 7d0b4dd

Please sign in to comment.