Class InappropriateJavadocBlockTagsOnTypeCheck

All Implemented Interfaces:
Configurable, Contextualizable

public class InappropriateJavadocBlockTagsOnTypeCheck extends AbstractJavadocCheck
Checks that Javadoc block tags for type definitions (class, interface, enum, record, annotation) do not contain tags that are semantically invalid for types. Specifically, @return and @throws/@exception tags are meaningless on type declarations since types neither return values nor throw exceptions.

Type declarations (classes, interfaces, enums, records, annotations) do not have return types or throw declarations. Therefore, @return and @throws/@exception Javadoc block tags used in their Javadoc comments are considered inappropriate and should be removed or replaced with proper documentation.

Since:
14.1.0
  • Field Details

    • MSG_INAPPROPRIATE_TAG

      public static final String MSG_INAPPROPRIATE_TAG
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • currentAst

      private DetailAST currentAst
      Java AST node whose attached Javadoc is currently being processed.
  • Constructor Details

    • InappropriateJavadocBlockTagsOnTypeCheck

      public InappropriateJavadocBlockTagsOnTypeCheck()
      Creates a new InappropriateJavadocBlockTagsOnTypeCheck instance.
  • Method Details