spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.77k stars 38.16k forks source link

Remove the `pure` attribute from `@Contract` #33820

Closed sdeleuze closed 1 month ago

sdeleuze commented 1 month ago

The @Contract annotation introduced via #32475 has a pure attribute that is coming from its org.jetbrains.annotations.Contract counterpart. It was historically used to trigger warnings when the return value is not used, but it looks like it is not the case anymore with IDEA 2023.1+ and the @CheckReturnValue annotation introduced in #33818 provides a more explicit signal, so we prefer to remove the pure attribute from @Contract in Spring Framework 6.2.0, letting to door open to a future reintroduction only if strong use cases arise.