Skip to content

JavadocParagraph false violation when <p> is inside of <div></div> #16630

@SteLeo1602

Description

@SteLeo1602

I have read check documentation: https://checkstyle.org/checks/javadoc/javadocparagraph.html#JavadocParagraph
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" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
		  "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
		  "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="TreeWalker">
    <module name="JavadocParagraph"/>
  </module>
</module>
/var/tmp $ cat Test.java
/**
 * <div>
 * This is the description.
 *
 * <p>
 * This is the paragraph.
 * </p>
 *
 * </div>
 *
 */
class Test {
}
/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"
/var/tmp $ java $RUN_LOCALE -jar checkstyle-X.XX-all.jar -c config.xml Test.java
Starting audit...
[ERROR] D:\Projects\work_checkstyle\Test.java:5:4: <p> tag should be preceded with an empty line. [JavadocParagraph]
Audit done.
Checkstyle ends with 1 errors.


Expect the check to pass <p> inside <div> </div> tags since <p> is already preceded by the empty line.

There should be violation even there no empty line, as nested paragraphs are ignored.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions