Class ConstructorCallsOverridableMethodRule

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

    public final class ConstructorCallsOverridableMethodRule
    extends AbstractJavaRulechainRule
    Searches through all methods and constructors called from constructors. It marks as dangerous any call to overridable methods from non-private constructors. It marks as dangerous any calls to dangerous private constructors from non-private constructors.
    Author:
    CL Gilbert (dnoyeb@users.sourceforge.net) TODO match parameter types. Aggressively strips off any package names. Normal compares the names as is. TODO What about interface declarations which can have internal classes
    • Constructor Detail

      • ConstructorCallsOverridableMethodRule

        public ConstructorCallsOverridableMethodRule()
    • Method Detail

      • start

        public void start​(net.sourceforge.pmd.reporting.RuleContext ctx)
        Specified by:
        start in interface net.sourceforge.pmd.lang.rule.Rule
        Overrides:
        start in class net.sourceforge.pmd.lang.rule.AbstractRule