Allow usage of `@CheckReturnValue` on types and ctors

Closes gh-34910
This commit is contained in:
Sébastien Deleuze 2025-06-17 16:41:36 +02:00
parent 74ee1b991a
commit f601bbb2ac
1 changed files with 4 additions and 1 deletions

View File

@ -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.
*
* <p>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 {
}