-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[java] CommentDefaultAccessModifier should consider lombok's @Value #4201
Copy link
Copy link
Closed
Labels
a:false-positivePMD flags a piece of code that is not problematicPMD flags a piece of code that is not problematic
Milestone
Description
Affects PMD Version:6.51.0
Rule: CommentDefaultAccessModifier
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier
Description:
In the following code example, annotation @Value can add modifiers to the field fo$o, contradicted with default access modifier, so that no need to add a comment before its declaration, and this is a false positive.
Code Sample demonstrating the issue:
import lombok.Value;
@Value
public class Test {
int fo$o;
}Expected outcome:
PMD reports a violation at line 4, but that's wrong. That's a false positive.
Running PMD through: CLI
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a:false-positivePMD flags a piece of code that is not problematicPMD flags a piece of code that is not problematic