Rule Set:
<rule ref="rulesets/java/design.xml"/>
Description:
The code below will be flagged by PMD with:
<violation beginline="6" endline="8" begincolumn="11" endcolumn="3" rule="UncommentedEmptyConstructor" ruleset="Design" package="com.ovyapp.android.feature.calendar" class="MyClass" method="MyClass" externalInfoUrl="https://pmd.github.io/pmd-5.5.5/pmd-java/rules/java/design.html#UncommentedEmptyConstructor" priority="3"> Document empty constructor </violation>
Maybe this rule could be relaxed when an annotation is applied on the constructor, especially if it's javax.inject.Inject
since this annotation can be picked up by annotation processors such as Dagger 2 and let them know that they can build the MyClass
class.
Code Sample demonstrating the issue:
import javax.inject.Inject; public class MyClass { @Inject MyClass() { } }
Running PMD 5.5.5 through: Gradle
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