Skip to content

Commit f601bbb

Browse files
committed
Allow usage of @CheckReturnValue on types and ctors
Closes gh-34910
1 parent 74ee1b9 commit f601bbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-core/src/main/java/org/springframework/lang/CheckReturnValue.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@
3333
* and the return value is only interesting when adding an element to a set,
3434
* to see if the set already contained that element before.
3535
*
36+
* <p>When used on a type, the annotation applies to all constructors and all
37+
* methods that do not return {@code void}.
38+
*
3639
* @author Sebastien Deleuze
3740
* @since 6.2
3841
*/
3942
@Documented
40-
@Target(ElementType.METHOD)
43+
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
4144
public @interface CheckReturnValue {
4245
}

0 commit comments

Comments
 (0)