Skip to content

Issue #17882: Update PARAM_BLOCK_TAG of JavadocCommentsTokenTypes to new AST format#17883

Merged
romani merged 1 commit into
checkstyle:masterfrom
checkstyle-GSoC25:issue-17882-param-block-tag
Oct 8, 2025
Merged

Issue #17882: Update PARAM_BLOCK_TAG of JavadocCommentsTokenTypes to new AST format#17883
romani merged 1 commit into
checkstyle:masterfrom
checkstyle-GSoC25:issue-17882-param-block-tag

Conversation

@mahfouz72

Copy link
Copy Markdown
Member

Part of #17882

D:\CS\test
cat src/Test.java
class Test {

    /**
     * Some javadoc comment.
     *
     * @param value The parameter of method.
     */
    void method(int value) {

    }
}
D:\CS\test
java -jar checkstyle-12.0.0-SNAPSHOT-all.jar -J src/Test.java | ForEach-Object { $_ -replace '\[[0-9]+:[0-9]+\]', '' }
COMPILATION_UNIT -> COMPILATION_UNIT 
`--CLASS_DEF -> CLASS_DEF 
    |--MODIFIERS -> MODIFIERS 
    |--LITERAL_CLASS -> class 
    |--IDENT -> Test 
    `--OBJBLOCK -> OBJBLOCK 
        |--LCURLY -> { 
        |--METHOD_DEF -> METHOD_DEF 
        |   |--MODIFIERS -> MODIFIERS 
        |   |--TYPE -> TYPE 
        |   |   |--BLOCK_COMMENT_BEGIN -> /* 
        |   |   |   |--COMMENT_CONTENT -> *\r\n     * Some javadoc comment.\r\n     *\r\n     * @param value The parameter of method.\r\n      
        |   |   |   |   `--JAVADOC_CONTENT -> JAVADOC_CONTENT 
        |   |   |   |       |--NEWLINE -> \r\n 
        |   |   |   |       |--LEADING_ASTERISK ->      * 
        |   |   |   |       |--TEXT ->  Some javadoc comment. 
        |   |   |   |       |--NEWLINE -> \r\n 
        |   |   |   |       |--LEADING_ASTERISK ->      * 
        |   |   |   |       |--NEWLINE -> \r\n 
        |   |   |   |       |--LEADING_ASTERISK ->      * 
        |   |   |   |       |--TEXT ->   
        |   |   |   |       |--JAVADOC_BLOCK_TAG -> JAVADOC_BLOCK_TAG 
        |   |   |   |       |   `--PARAM_BLOCK_TAG -> PARAM_BLOCK_TAG 
        |   |   |   |       |       |--AT_SIGN -> @
        |   |   |   |       |       |--TAG_NAME -> param
        |   |   |   |       |       |--TEXT ->
        |   |   |   |       |       |--PARAMETER_NAME -> value
        |   |   |   |       |       `--DESCRIPTION -> DESCRIPTION
        |   |   |   |       |           `--TEXT ->  The parameter of method.
        |   |   |   |       |--NEWLINE -> \r\n
        |   |   |   |       `--TEXT ->
        |   |   |   `--BLOCK_COMMENT_END -> */
        |   |   `--LITERAL_VOID -> void
        |   |--IDENT -> method
        |   |--LPAREN -> (
        |   |--PARAMETERS -> PARAMETERS
        |   |   `--PARAMETER_DEF -> PARAMETER_DEF
        |   |       |--MODIFIERS -> MODIFIERS
        |   |       |--TYPE -> TYPE
        |   |       |   `--LITERAL_INT -> int
        |   |       `--IDENT -> value
        |   |--RPAREN -> )
        |   `--SLIST -> {
        |       `--RCURLY -> }
        `--RCURLY -> }

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item

* JAVADOC_CONTENT -> JAVADOC_CONTENT
* |--LEADING_ASTERISK -> *
* |--TEXT ->
* `--JAVADOC_BLOCK_TAG -> JAVADOC_BLOCK_TAG

@romani romani Oct 7, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this node JAVADOC_BLOCK_TAG as root of tree snippet

As users in real life will have different jadadoc_contet

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mahfouz72 mahfouz72 force-pushed the issue-17882-param-block-tag branch from 1515f97 to ecc9afe Compare October 7, 2025 23:06

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot .
Ok to merge if CI pass.

Trailing spaces should be removed, please do.

@mahfouz72 mahfouz72 force-pushed the issue-17882-param-block-tag branch from ecc9afe to 545d32f Compare October 7, 2025 23:31
@romani romani merged commit fdd3841 into checkstyle:master Oct 8, 2025
119 of 120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants