From 09d87fac57c009e4de7a86fc31625ed565306401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 30 Oct 2024 14:22:50 +0100 Subject: [PATCH] Annotate RestClient retrieve() with `@CheckReturnValue` This annotation triggers a warning in IDEs supporting `@CheckReturnValue` when retrieve() return value is not used. Closes gh-33818 --- .../main/java/org/springframework/web/client/RestClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-web/src/main/java/org/springframework/web/client/RestClient.java b/spring-web/src/main/java/org/springframework/web/client/RestClient.java index f25e3f0c2e4c..1b7016d77e5a 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestClient.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestClient.java @@ -44,6 +44,7 @@ import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.observation.ClientRequestObservationConvention; import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.lang.CheckReturnValue; import org.springframework.lang.Nullable; import org.springframework.util.MultiValueMap; import org.springframework.web.util.DefaultUriBuilderFactory; @@ -644,6 +645,7 @@ interface RequestHeadersSpec> { * {@link ResponseSpec#onStatus(Predicate, ResponseSpec.ErrorHandler) onStatus} handlers. * @return {@code ResponseSpec} to specify how to decode the body */ + @CheckReturnValue ResponseSpec retrieve(); /**