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

Parse errors if @see spans multiple lines #16005

Open
cowwoc opened this issue Dec 5, 2024 · 4 comments
Open

Parse errors if @see spans multiple lines #16005

cowwoc opened this issue Dec 5, 2024 · 4 comments

Comments

@cowwoc
Copy link

cowwoc commented Dec 5, 2024

I have read check documentation: https://checkstyle.org/checks/javadoc/javadocmethod.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

javac src\main\java\Testcase.java
# no errors/warnings

/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="SuppressWarningsHolder"/>
        <module name="InvalidJavadocPosition"/>

        <module name="JavadocBlockTagLocation"/>
        <module name="JavadocMissingLeadingAsterisk"/>
        <module name="JavadocMissingWhitespaceAfterAsterisk"/>
        <module name="JavadocTagContinuationIndentation">
            <property name="offset" value="1"/>
        </module>
        <module name="NonEmptyAtclauseDescription"/>
        <module name="RequireEmptyLineBeforeBlockTagGroup"/>
        <module name="SingleLineJavadoc">
            <property name="ignoreInlineTags" value="false"/>
        </module>
    </module>
</module>

/var/tmp $ cat YOUR_FILE.java

public class Testcase {
    /**
     * The name of the ECDSA (Elliptic Curve Digital Signature Algorithm).
     *
     * @see <a
     * href="https://docs.oracle.com/en/java/javase/23/docs/specs/security/standard-names.html#keypairgenerator-algorithms">
     * KeyPairGenerator Algorithms</a>.
     */
    public static final String ELLIPTIC_CURVE_ALGORITHM = "EC";
}
set RUN_LOCALE="-Duser.language=en -Duser.country=US"
java %RUN_LOCALE% -jar checkstyle-10.20.2-all.jar -c config.xml Testcase.java
Starting audit...
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [JavadocBlockTagLocation]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [JavadocMissingLeadingAsterisk]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [JavadocMissingWhitespaceAfterAsterisk]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [JavadocTagContinuationIndentation]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [NonEmptyAtclauseDescription]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [RequireEmptyLineBeforeBlockTagGroup]
[ERROR] C:\Users\Gili\Documents\3rdparty\checkstyle-javadoc-parsing\Testcase.java:7: Javadoc comment at column 38 has parse error. Details: mismatched input '.' expecting <EOF> while parsing JAVADOC [SingleLineJavadoc]
Audit done.
Checkstyle ends with 7 errors.

Describe what you expect in detail.

No parsing errors since the javadoc in JDK 23.0.1 tool does not report any parsing problems.

@romani romani changed the title False-positives if @see spans multiple lines Parse errors if @see spans multiple lines Dec 10, 2024
@brunodmartins
Copy link

I want to work on this issue! @romani could you assign it to me?

@romani
Copy link
Member

romani commented Dec 15, 2024

No assignments, just make comment "I am on it" and start working.

@chaitanyanivsarkar
Copy link

i am on it.

@romani
Copy link
Member

romani commented Jan 14, 2025

It is not easy issue, if you are new to project I recommend to do "good xxxxx issue" first.

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

No branches or pull requests

4 participants