Class UnnecessaryConstructorRule

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.ast.AstVisitor, JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

    public class UnnecessaryConstructorRule
    extends net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
    This rule detects when a constructor is not necessary; i.e., when there is only one constructor, it’s public, has an empty body, and takes no arguments.
    • Constructor Detail

      • UnnecessaryConstructorRule

        public UnnecessaryConstructorRule()
    • Method Detail

      • buildTargetSelector

        protected @NonNull net.sourceforge.pmd.lang.rule.RuleTargetSelector buildTargetSelector()
        Overrides:
        buildTargetSelector in class net.sourceforge.pmd.lang.rule.AbstractRule
      • defaultSuppressionAnnotations

        protected Collection<String> defaultSuppressionAnnotations()
        Overrides:
        defaultSuppressionAnnotations in class net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule