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

Ending period detected in first sentence of Javadoc when it is not at the end of the sentence #14750

Open
patchwork01 opened this issue Apr 2, 2024 · 1 comment · May be fixed by #14690
Open
Labels

Comments

@patchwork01
Copy link
Contributor

patchwork01 commented Apr 2, 2024

I have read check documentation: https://checkstyle.org/checks/javadoc/summaryjavadoc.html
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 TestCheckstyleJavadocSummary.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="SummaryJavadoc"/>
    </module>
</module>

/var/tmp $ cat TestCheckstyleJavadocSummary.java
public class TestCheckstyleJavadocSummary {

    /**
     * Summary sentence with version number 1.0 in the middle but no period at the end
     */
    void foo1() {
    }
}

/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"

/var/tmp $ java $RUN_LOCALE -jar checkstyle-10.14.2-all.jar -c config.xml TestCheckstyleJavadocSummary.java
Starting audit...
Audit done.

The given input should fail the check as there is no period at the end of the sentence. The check can find the period that ends a sentence by checking if there's a whitespace character after the period.


This bug was found while addressing the following issue:

While fixing that, I also fixed this.

@romani
Copy link
Member

romani commented Apr 5, 2024

will be fixed in scope of fix for #14689

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