Skip to content

Introduce @CheckReturnValue annotation #33818

@rstoyanchev

Description

@rstoyanchev

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions