A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/4515 below:

[java] CommentRequired doesn't consider annotations and records · Issue #4515 · pmd/pmd · GitHub

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4