From 8f96205579e2f4c5967c7ede56a33a387bb917e1 Mon Sep 17 00:00:00 2001 From: Johan Vandeweerd Date: Thu, 16 May 2019 14:53:34 +0200 Subject: [PATCH] Add Javadoc to rawStatusCode method that is not part of ClientResponse in spring-webflux-5.0 --- .../client/ClientResponseWrapper.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dd-java-agent/instrumentation/spring-webflux/src/main/java8/datadog/trace/instrumentation/springwebflux/client/ClientResponseWrapper.java b/dd-java-agent/instrumentation/spring-webflux/src/main/java8/datadog/trace/instrumentation/springwebflux/client/ClientResponseWrapper.java index 463e70921e..20177d11e1 100644 --- a/dd-java-agent/instrumentation/spring-webflux/src/main/java8/datadog/trace/instrumentation/springwebflux/client/ClientResponseWrapper.java +++ b/dd-java-agent/instrumentation/spring-webflux/src/main/java8/datadog/trace/instrumentation/springwebflux/client/ClientResponseWrapper.java @@ -13,7 +13,9 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.context.Context; -/** Wrapper class for ClientResponse that adds Context to the body Publisher */ +/** + * Wrapper class for ClientResponse that adds Context to the body Publisher + */ public class ClientResponseWrapper implements ClientResponse { private final ClientResponse clientResponse; @@ -81,10 +83,19 @@ public class ClientResponseWrapper implements ClientResponse { @Override public Mono>> toEntityList( - final ParameterizedTypeReference typeReference) { + final ParameterizedTypeReference typeReference) { return clientResponse.toEntityList(typeReference); } + /** + * ClientResponseWrapper is based on the ClientResponse from + * spring-webflux-5.0.0.RELEASE. Since spring-webflux 5.1 ClientResponse + * contains extra methods like rewStatusCode and gives methodNotFound + * exceptions at runtime if used in a project with the latest spring-webflux + * 5.1 or higher. + *

+ * See https://docs.spring.io/spring/docs/5.1.x/javadoc-api/org/springframework/web/reactive/function/client/ClientResponse.html#rawStatusCode-- + */ public int rawStatusCode() { return clientResponse.statusCode().value(); }