[java] CommentDefaultAccessModifier comment needs to be before annotation if present #4578
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
Affects PMD Version: 7.0.0-rc2
Rule:
CommentDefaultAccessModifier
Description:
Code Sample demonstrating the issue:
Expected outcome:
(I'm not sure if this is intended, and it's probably a matter of opinion.)
test1
above, where the comment meant to represent a package modifier is after the annotation on that method, aCommentDefaultAccessModifier
rule violation is flagged up.test2
, where that comment is before the annotation.Since
/* package */
seems to be intended to replace apublic
/private
/protected
modifier that doesn't exist for default access, it feels it would fit more naturally where those modifiers would be, i.e. between the annotations and the return type (as intest1
).However, this is currently flagged as a
CommentDefaultAccessModifier
rule violation.Running PMD through: Maven (using maven-pmd-plugin version 3.20.1-pmd-7-SNAPSHOT configured with PMD 7.0.0-rc2)
The text was updated successfully, but these errors were encountered: