After #33777, the retrieve()
method in RestClient
no longer executes, and instead expects one of the ResponseSpec
methods to be called. It is possible that some applications rely on the current behavior, for example if they don't care for the actual response as long as it is not an error. However, using the ResponseSpec
is and was expected to avoid other side effects.
We should add a @CheckReturnValue
annotation for this and other similar API cases that would allow IDE's to warn about not using the return value, along side the @Contract
annotation added in #32475.