Affects PMD Version: 6.x/7.0.0-rc1
Rule: CommentRequired
Description:
With PMD 7.0.0-rc1, methods inside annotations are now reported. But a missing type-level javadoc for the annotation type is not reported.
Also, missing type-level javadoc for records are not reported.
Found via #3123.
When fixing that, we probably need two additional properties: annotationCommentRequirement and recordCommentRequirement.
Code Sample demonstrating the issue:
@interface MyAnnotation1 { // comment required
String name(); // comment required
int version(); // comment required
}
record MyRecord(int a) {} // comment required
Expected outcome:
PMD 7.0.0-rc1 reports only 2 violations at line 2+3. PMD 6.55.0 doesn't report these at all.
PMD should report a violation at line 1+6, but doesn't. This is a false-negative.
Affects PMD Version: 6.x/7.0.0-rc1
Rule: CommentRequired
Description:
With PMD 7.0.0-rc1, methods inside annotations are now reported. But a missing type-level javadoc for the annotation type is not reported.
Also, missing type-level javadoc for records are not reported.
Found via #3123.
When fixing that, we probably need two additional properties:
annotationCommentRequirementandrecordCommentRequirement.Code Sample demonstrating the issue:
Expected outcome:
PMD 7.0.0-rc1 reports only 2 violations at line 2+3. PMD 6.55.0 doesn't report these at all.
PMD should report a violation at line 1+6, but doesn't. This is a false-negative.