[java] CommentRequired should ignore private static final field or Logger field
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
Research direction
Start with the CommentRequired rule documentation and its handling of fieldCommentRequirement, then reproduce the reported Java examples through the Maven Plugin. Check how private static final fields and Logger fields are classified, and add regression coverage showing that the requested fields are ignored while other required fields remain checked.
Written by the indexing model from the issue text.
Description
Affects PMD Version:
6.55.0
7.0.0
Rule:
https://docs.pmd-code.org/latest/pmd_rules_java_documentation.html#commentrequired
Description:
CommentRequired checked block private static final field and Logger field.
Code Sample demonstrating the issue:
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPaging.class);
private static final Integer maxLimitCount = 10;
Update Rule:
<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="fieldCommentRequirement" value="Required" />
<property name="privateStaticFinalNamedFieldIgnored" value="LOGGER|LOG|log" />
<property name="privateStaticFinalField" value="Ignored" />
</properties>
</rule>
Running PMD through: [Maven Plugin]
- Dominant language
- Java
- Stars
- 5.5k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pmd/pmd
-
an:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
a:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
an:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
a:bug
-
an:enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spring-projects/spring-modulith#1895 ·