Introduce @CheckReturnValue
annotation
#33818
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
After #33777, the
retrieve()
method inRestClient
no longer executes, and instead expects one of theResponseSpec
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 theResponseSpec
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.The text was updated successfully, but these errors were encountered: