Skip to content

Files

Latest commit

 

History

History
44 lines (25 loc) · 944 Bytes

MissingDeprecated.md

File metadata and controls

44 lines (25 loc) · 944 Bytes

Pattern: Missing java.lang.Deprecated annotation and/or @deprecated tag

Issue: -

Description

Verifies that both the java.lang.Deprecated annotation is present and the @deprecated Javadoc tag is present when either is present.

Examples

To configure the check:

<module name="MissingDeprecated"/>

In addition you can configure this check with skipNoJavadoc option:

<module name="MissingDeprecated">
    <property name="skipNoJavadoc" value="true" />
</module>

Examples of validating source code with skipNoJavadoc:

@deprecated
public static final int MY_CONST = 123456; // no violation
 

/** This Javadoc is missing deprecated tag. */
@deprecated
public static final int COUNTER = 10; // violation as Javadoc exists

Further Reading