Annotate RestClient retrieve() with `@CheckReturnValue`

This annotation triggers a warning in IDEs supporting
`@CheckReturnValue` when retrieve() return value is not
used.

Closes gh-33818
This commit is contained in:
Sébastien Deleuze 2024-10-30 14:22:50 +01:00
parent a005c325f7
commit 09d87fac57
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,7 @@ import org.springframework.http.client.ClientHttpRequestInterceptor;
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 @@ public interface RestClient {
* {@link ResponseSpec#onStatus(Predicate, ResponseSpec.ErrorHandler) onStatus} handlers.
* @return {@code ResponseSpec} to specify how to decode the body
*/
@CheckReturnValue
ResponseSpec retrieve();
/**