diff --git a/spring-core/src/main/java/org/springframework/lang/CheckReturnValue.java b/spring-core/src/main/java/org/springframework/lang/CheckReturnValue.java index 57a400c7f11..1d8ff9fcfbb 100644 --- a/spring-core/src/main/java/org/springframework/lang/CheckReturnValue.java +++ b/spring-core/src/main/java/org/springframework/lang/CheckReturnValue.java @@ -33,10 +33,13 @@ import java.lang.annotation.Target; * and the return value is only interesting when adding an element to a set, * to see if the set already contained that element before. * + *
When used on a type, the annotation applies to all constructors and all + * methods that do not return {@code void}. + * * @author Sebastien Deleuze * @since 6.2 */ @Documented -@Target(ElementType.METHOD) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR}) public @interface CheckReturnValue { }