Skip to content

Pull #19880: resolve Qodana inspections in Javadoc and test utilities#19880

Merged
romani merged 1 commit into
checkstyle:masterfrom
ZaheerAhmadDev:quodana
May 21, 2026
Merged

Pull #19880: resolve Qodana inspections in Javadoc and test utilities#19880
romani merged 1 commit into
checkstyle:masterfrom
ZaheerAhmadDev:quodana

Conversation

@ZaheerAhmadDev

@ZaheerAhmadDev ZaheerAhmadDev commented May 18, 2026

Copy link
Copy Markdown
Contributor

@ZaheerAhmadDev ZaheerAhmadDev force-pushed the quodana branch 3 times, most recently from f067b8e to 4f9021c Compare May 18, 2026 09:14

@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, clarification:

Comment thread config/qodana.yml Outdated
- src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/ParseTreeBuilder.java
- src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/ParseTreeBuilder.java
- src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocCommentsTokenTypes.java
- src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocCommentsTokenTypes.java

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.

We try to keep there permanent suppression.
If any temporary suppression requires, we can create issue to fix they, list them in description of issue and put above suppression comment "untill xxxxx" to make it clear it is temporary

@ZaheerAhmadDev ZaheerAhmadDev force-pushed the quodana branch 4 times, most recently from 7b6da50 to f20fb6d Compare May 19, 2026 15:24
@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

Github, generate website

@romani

romani commented May 19, 2026

Copy link
Copy Markdown
Member

This PR became not that minor.

On next push, please put prefix "Pull #19880" to commit

ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 19, 2026
ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 19, 2026
ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 19, 2026
@ZaheerAhmadDev ZaheerAhmadDev changed the title Minor: checking qodana issue Pull #19880: resolve Qodana inspections in Javadoc and test utilities May 19, 2026
@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

Github, generate website

@ZaheerAhmadDev

ZaheerAhmadDev commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Solved all the issue related to Qodana. Please review it.
one CI failures is Unrelated to this pr.
I guess it is related to:checkstyle/contribution#1052

ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 19, 2026
@romani

romani commented May 20, 2026

Copy link
Copy Markdown
Member

InheritDoc looks bad

Screenshot_20260519-222022

:( not good. But it might be caused by javadoc to xdoc translation logic that we own.
Let's put all such problematic cases to separate issue and keep suppress on them, we will deal with them separate after merge of this initial version bumping

ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 20, 2026
ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 20, 2026
ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 20, 2026
ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 20, 2026
@ZaheerAhmadDev

ZaheerAhmadDev commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Well i was thinking that javadoc might not generate the {@literal}. so the doc will be same and error will be solved. but it didn't work though :).
Moved UnnecessaryInheritDoc suppression in qodana.yaml temporary and put above comment pointing to issue.
Opened it issue for it: #19895

@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.

Items

* {@code Modifier#MANDATED} as a hexadecimal value, padded with zeros to a width of four characters.</p>
* <pre>{@code
* {@value %04x Modifier#MANDATED}
* String.format("0x%04x", Modifier.MANDATED)

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.

If we need to change it, we have to regenerate AST that it printed below

@ZaheerAhmadDev ZaheerAhmadDev May 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here is the new AST :

COMPILATION_UNIT -> COMPILATION_UNIT [1:1]
`--CLASS_DEF -> CLASS_DEF [1:1]
    |--MODIFIERS -> MODIFIERS [1:1]
    |   `--LITERAL_PUBLIC -> public [1:1]
    |--LITERAL_CLASS -> class [1:8]
    |--IDENT -> Test [1:14]
    `--OBJBLOCK -> OBJBLOCK [1:19]
        |--LCURLY -> { [1:19]
        |--VARIABLE_DEF -> VARIABLE_DEF [7:5]
        |   |--MODIFIERS -> MODIFIERS [7:5]
        |   |   |--BLOCK_COMMENT_BEGIN -> /* [4:5]
        |   |   |   |--COMMENT_CONTENT -> *\n     * {@value %04x java.lang.reflect.Modifier#PUBLIC}\n      [4:7]
        |   |   |   |   `--JAVADOC_CONTENT -> JAVADOC_CONTENT [4:8]
        |   |   |   |       |--NEWLINE -> \n [4:8]
        |   |   |   |       |--LEADING_ASTERISK ->      * [5:1]
        |   |   |   |       |--TEXT ->   [5:7]
        |   |   |   |       |--JAVADOC_INLINE_TAG -> JAVADOC_INLINE_TAG [5:8]
        |   |   |   |       |   `--VALUE_INLINE_TAG -> VALUE_INLINE_TAG [5:8]
        |   |   |   |       |       |--JAVADOC_INLINE_TAG_START -> {@ [5:8]
        |   |   |   |       |       |--TAG_NAME -> value [5:10]
        |   |   |   |       |       |--TEXT ->   [5:15]
        |   |   |   |       |       |--FORMAT_SPECIFIER -> %04x [5:16]
        |   |   |   |       |       |--TEXT ->   [5:20]
        |   |   |   |       |       |--REFERENCE -> REFERENCE [5:21]
        |   |   |   |       |       |   |--IDENTIFIER -> java.lang.reflect.Modifier [5:21]
        |   |   |   |       |       |   |--HASH -> # [5:47]
        |   |   |   |       |       |   `--MEMBER_REFERENCE -> MEMBER_REFERENCE [5:48]
        |   |   |   |       |       |       `--IDENTIFIER -> PUBLIC [5:48]
        |   |   |   |       |       `--JAVADOC_INLINE_TAG_END -> } [5:54]
        |   |   |   |       |--NEWLINE -> \n [5:55]
        |   |   |   |       `--TEXT ->       [6:1]
        |   |   |   `--BLOCK_COMMENT_END -> */ [6:6]
        |   |   |--LITERAL_PUBLIC -> public [7:5]
        |   |   |--LITERAL_STATIC -> static [7:12]
        |   |   `--FINAL -> final [7:19]
        |   |--TYPE -> TYPE [7:25]
        |   |   `--LITERAL_INT -> int [7:25]
        |   |--IDENT -> FORMAT_SPECIFIER [7:29]
        |   |--ASSIGN -> = [7:46]
        |   |   `--EXPR -> EXPR [7:48]
        |   |       `--NUM_INT -> 36 [7:48]
        |   `--SEMI -> ; [7:50]
        `--RCURLY -> } [8:1]

Updated the tree.

ZaheerAhmadDev added a commit to ZaheerAhmadDev/checkstyle that referenced this pull request May 20, 2026

@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

@romani romani merged commit c1d3081 into checkstyle:master May 21, 2026
129 checks passed
@github-actions github-actions Bot added this to the 13.5.0 milestone May 21, 2026
@ZaheerAhmadDev ZaheerAhmadDev deleted the quodana branch May 21, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants