Issue #19770: Improve JavadocTypeCheck to handle parameter …#19797
Merged
romani merged 1 commit intoMay 16, 2026
Conversation
5edc68b to
ef94ad3
Compare
Contributor
Author
|
Step to repoduce using the same as mentioned in issue #19770 |
e1cd528 to
6062a6c
Compare
Member
|
Please read and watch playlist videos at Starting_Development. |
3de50e9 to
b39be4d
Compare
7f90b8b to
4cd4f8d
Compare
a8dfead to
22ea06a
Compare
Contributor
Author
|
@romani done, please review. |
Member
|
Github, generate report for JavadocType/all-examples-in-one |
Contributor
|
Report for JavadocType/all-examples-in-one: |
Member
|
@romani new violations are expected, ok for me |
22ea06a to
b4bd930
Compare
romani
requested changes
May 13, 2026
Member
|
report is good. messages in diff report are very confusing, reported #19806 to fix them |
c6b3026 to
50022c4
Compare
942072a to
1accef9
Compare
Member
1accef9 to
60f83ea
Compare
Contributor
Author
|
@romani commit message updated. |
Member
|
@mgustimz , thanks a lot for quick fix, please to work with you |
Contributor
Author
|
@romani my pleasure😁 |
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.


Description
Fixes #19770 - JavadocTypeCheck incorrectly matches record component @param tags using prefix instead of exact match.
Root Cause
In
JavadocTypeCheck.checkComponentParamTag(), the matching logic usedindexOf() == 0:This means any
@paramtag whose argument starts with the component name as a prefix would match. For example, with a record component namedjohn,@param john123was incorrectly treated as documentingjohnbecausejohn123.indexOf(john) == 0.Fix
Changed to exact match or space-separated match:
This ensures:
@param johnmatches record componentjohn(exact match)@param john some descriptionmatches record componentjohn(name + space prefix)@param john123does NOT match record componentjohn(different name)The existing
checkUnusedParamTags()already usesextractParamNameFromTag()which properly extracts the param name via regex, so it correctly reportsjohn123as an unused tag.Testing
Added
InputJavadocTypeRecordComponentPrefixMatch.javatest case that reproduces the exact scenario from issue #19770.