Class PrematureDeclarationRule

  • All Implemented Interfaces:
    AstVisitor, JavaVisitor, Rule, PropertySource

    public class PrematureDeclarationRule
    extends AbstractJavaRulechainRule
    Checks for variables in methods that are defined before they are really needed. A reference is deemed to be premature if it is created ahead of a block of code that doesn't use it that also has the ability to return or throw an exception.
    Author:
    Brian Remedios