Skip to content

JavadocType: violation message is confusing and requires quotes #19806

@romani

Description

@romani

I have read check documentation: https://checkstyle.org/checks/javadoc/javadoctype.html#JavadocType
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words

/var/tmp $ javac Test.java

/var/tmp $ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
  "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
  "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="TreeWalker">
    <module name="JavadocType"/>
  </module>
</module>

/var/tmp $ cat Test.java
// violation 4 lines below 'Unused Javadoc tag.'
/**
 * Example case with bare @param tag
 *
 * @param
 */
public record Test(String value) {
    // violation above 'Type Javadoc comment is missing @param value tag.'
}

/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"
/var/tmp $ java $RUN_LOCALE -jar checkstyle-X.XX-all.jar -c config.xml YOUR_FILE.java

Violation should be: Type Javadoc comment is missing @param 'value' tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions