Repository navigation
Fix JavadocAlignParameterDescriptionCheck with inline tags - #14427
Merged
Merged
Conversation
Member
|
Do we also have a problem if a 2nd, or 3rd line in a parameter description starts with an |
Contributor
Author
|
Nope, Checkstyle parses the leading indentation before Added a test case for this in the latest commit as well. |
Doc94
approved these changes
Oct 27, 2026
Doc94
left a comment
Member
There was a problem hiding this comment.
With the tests based in issue seems fine to include.
Machine-Maker
approved these changes
Oct 27, 2026
Warriorrrr
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #14405
Problem
When a parameter description contains inline tags (such as {@link ...}), Checkstyle produces multiple \TEXT\ tokens on the same line (the text preceding the tag and the text trailing the tag). \JavadocAlignParameterDescriptionCheck\ was evaluating all text nodes indiscriminately, causing trailing tokens on the same line (which start at column 70+) to be treated as separate description lines. This artificially inflated \maxColumn\ and caused false-positive alignment violations across the entire block.
Solution
Track visited line numbers so that only the first \TEXT\ node on each distinct line is evaluated for parameter description column alignment. Subsequent text tokens on the same line are ignored for indentation purposes.
Includes the test case provided by @Warriorrrr in #14405.