All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puppycrawl.tools.checkstyle.meta.checks.annotation.MissingDeprecatedCheck.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-metadata>
   <module>
      <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"
             name="MissingDeprecated"
             parent="com.puppycrawl.tools.checkstyle.TreeWalker">
         <description>&lt;p&gt;
 Verifies that the annotation {@code @Deprecated} and the Javadoc tag
 {@code @deprecated} are both present when either of them is present.
 &lt;/p&gt;
 &lt;p&gt;
 Both ways of flagging deprecation serve their own purpose.
 The &amp;#64;Deprecated annotation is used for compilers and development tools.
 The &amp;#64;deprecated javadoc tag is used to document why something is deprecated
 and what, if any, alternatives exist.
 &lt;/p&gt;
 &lt;p&gt;
 In order to properly mark something as deprecated both forms of
 deprecation should be present.
 &lt;/p&gt;
 &lt;p&gt;
 Package deprecation is a exception to the rule of always using the
 javadoc tag and annotation to deprecate.  It is not clear if the javadoc
 tool will support it or not as newer versions keep flip flopping on if
 it is supported or will cause an error. See
 &lt;a href="https://bugs.openjdk.java.net/browse/JDK-8160601"&gt;JDK-8160601&lt;/a&gt;.
 The deprecated javadoc tag is currently the only way to say why the package
 is deprecated and what to use instead.  Until this is resolved, if you don't
 want to print violations on package-info, you can use a
 &lt;a href="https://checkstyle.org/config_filters.html"&gt;filter&lt;/a&gt; to ignore
 these files until the javadoc tool faithfully supports it. An example config
 using SuppressionSingleFilter is:
 &lt;/p&gt;
 &lt;pre&gt;
 &amp;lt;!-- required till https://bugs.openjdk.java.net/browse/JDK-8160601 --&amp;gt;
 &amp;lt;module name="SuppressionSingleFilter"&amp;gt;
     &amp;lt;property name="checks" value="MissingDeprecatedCheck"/&amp;gt;
     &amp;lt;property name="files" value="package-info\.java"/&amp;gt;
 &amp;lt;/module&amp;gt;
 &lt;/pre&gt;</description>
         <properties>
            <property default-value="false"
                      name="violateExecutionOnNonTightHtml"
                      type="boolean">
               <description>Control when to
 print violations if the Javadoc being examined by this check violates the
 tight html rules defined at
 &lt;a href="https://checkstyle.org/writingjavadocchecks.html#Tight-HTML_rules"&gt;
 Tight-HTML Rules&lt;/a&gt;.</description>
            </property>
         </properties>
         <message-keys>
            <message-key key="annotation.missing.deprecated"/>
            <message-key key="javadoc.duplicateTag"/>
            <message-key key="javadoc.missed.html.close"/>
            <message-key key="javadoc.parse.rule.error"/>
            <message-key key="javadoc.wrong.singleton.html.tag"/>
         </message-keys>
      </check>
   </module>
</checkstyle-metadata>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy