Skip to content

Commit 09d87fa

Browse files
committed
Annotate RestClient retrieve() with @CheckReturnValue
This annotation triggers a warning in IDEs supporting `@CheckReturnValue` when retrieve() return value is not used. Closes gh-33818
1 parent a005c32 commit 09d87fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-web/src/main/java/org/springframework/web/client/RestClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.springframework.http.client.ClientHttpResponse;
4545
import org.springframework.http.client.observation.ClientRequestObservationConvention;
4646
import org.springframework.http.converter.HttpMessageConverter;
47+
import org.springframework.lang.CheckReturnValue;
4748
import org.springframework.lang.Nullable;
4849
import org.springframework.util.MultiValueMap;
4950
import org.springframework.web.util.DefaultUriBuilderFactory;
@@ -644,6 +645,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
644645
* {@link ResponseSpec#onStatus(Predicate, ResponseSpec.ErrorHandler) onStatus} handlers.
645646
* @return {@code ResponseSpec} to specify how to decode the body
646647
*/
648+
@CheckReturnValue
647649
ResponseSpec retrieve();
648650

649651
/**

0 commit comments

Comments
 (0)