Class PrematureDeclarationRule

  • All Implemented Interfaces:
    JavaParserVisitor, ImmutableLanguage, PropertySource, Rule

    public class PrematureDeclarationRule
    extends AbstractJavaRule
    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