Class UnnecessaryConstructorRule

java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.lang.rule.AbstractRule
net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
net.sourceforge.pmd.lang.java.rule.codestyle.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 Details

    • UnnecessaryConstructorRule

      public UnnecessaryConstructorRule()
  • Method Details

    • 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
    • visit

      public Object visit(ASTClassDeclaration node, Object data)
    • visit

      public Object visit(ASTEnumDeclaration node, Object data)