Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive: SummaryJavadocCheck #11213

Closed
Vyom-Yadav opened this issue Jan 17, 2022 · 2 comments · Fixed by #11383
Closed

False positive: SummaryJavadocCheck #11213

Vyom-Yadav opened this issue Jan 17, 2022 · 2 comments · Fixed by #11383
Milestone

Comments

@Vyom-Yadav
Copy link
Member

Vyom-Yadav commented Jan 17, 2022

From comment1 and comment2
I have read check documentation: https://checkstyle.sourceforge.io/config_javadoc.html#SummaryJavadoc
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 Test2.java

/var/tmp $ cat config.xml
<?xml version="1.0"?>
<!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="SummaryJavadocCheck"/>
    </module>
</module>

/var/tmp $ cat Test2.java
// unexpected violation below
/**
 * This is the actual summary.
 * {@summary This is wrong usage}
 */
public class Test2 {
}

// expected violation below
/**
 * This is summary
 */
class foo {
}

/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"
/var/tmp $ java $RUN_LOCALE -jar checkstyle-9.2.1-all.jar -c config.xml Test2.java
Starting audit...
[ERROR] /home/vyom/IdeaProjects/ConfigCheckstyle/src/TestP/Test2.java:2: Summary of Javadoc is missing an ending period. [SummaryJavadoc]
[ERROR] /home/vyom/IdeaProjects/ConfigCheckstyle/src/TestP/Test2.java:10: First sentence of Javadoc is missing an ending period. [SummaryJavadoc]
Audit done.
Checkstyle ends with 2 errors.

Describe what you expect in detail.

Starting audit...
[ERROR] /home/vyom/IdeaProjects/ConfigCheckstyle/src/TestP/Test2.java:10: First sentence of Javadoc is missing an ending period. [SummaryJavadoc]
Audit done.

If the first line is present then @summary is ignored, though a warning is given by the Javadoc tool.

Test.java:4: warning: invalid use of @summary
     * {@summary This is wrong usage}

see all details at #11051 (comment)

Expected: only violation on second javadoc

@Vyom-Yadav
Copy link
Member Author

on it.

Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 9, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 10, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 10, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 10, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 10, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 12, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 12, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 13, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 13, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 14, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 15, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 17, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 17, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 17, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 17, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 17, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 18, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 18, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 18, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 21, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 22, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Mar 22, 2022
@pbludov pbludov added the bug label Mar 23, 2022
@pbludov pbludov added this to the 10.1 milestone Mar 23, 2022
@pbludov
Copy link
Member

pbludov commented Mar 23, 2022

Fix is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants