Issue #7176: Add AnnotatedMethodVisibilityModifierCheck#19164
Open
gianmarcoschifone wants to merge 1 commit into
Open
Issue #7176: Add AnnotatedMethodVisibilityModifierCheck#19164gianmarcoschifone wants to merge 1 commit into
gianmarcoschifone wants to merge 1 commit into
Conversation
4f3a4e1 to
7170a03
Compare
Member
Author
|
GitHub, generate website |
Member
Author
|
GitHub, generate report |
Member
Author
|
GitHub, generate website |
Member
Author
|
Hi @romani , PR is ready for review. |
91c9fdf to
2281c83
Compare
romani
requested changes
May 25, 2026
| * element, its visibility modifier must match one of the allowed values. | ||
| * </p> | ||
| * | ||
| * @since 13.4.0 |
romani
requested changes
May 25, 2026
Member
romani
left a comment
There was a problem hiding this comment.
if we fully targeting to Methods, do we need extra tokens for types ?
| TokenTypes.IMPORT, | ||
| // tokens that can have annotations | ||
| TokenTypes.CLASS_DEF, | ||
| TokenTypes.INTERFACE_DEF, |
Member
There was a problem hiding this comment.
something wrong with name of Check.
Method Visibility vs target Class.
Member
Author
There was a problem hiding this comment.
The check should target any token that can have a visibility modifier, not just method, as reported in #7176.
Could we rename the check to AnnotatedVisibilityModifier?
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.
Issue #7176
Contribution repo PR: checkstyle/contribution#1042
New module config: https://gist.githubusercontent.com/gianmarcoschifone/45d9200df8159aec19512b81c377eb04/raw/fc481f46ec46b7a61839fbf1728bd8e8dbaa126d/annotatedmethodvisibilitymodifier.xml