diff --git a/pmd/src/net/sourceforge/pmd/rules/design/TooManyFields.java b/pmd/src/net/sourceforge/pmd/rules/design/TooManyFields.java index cda4a2706e..d7b4185365 100644 --- a/pmd/src/net/sourceforge/pmd/rules/design/TooManyFields.java +++ b/pmd/src/net/sourceforge/pmd/rules/design/TooManyFields.java @@ -23,7 +23,6 @@ public class TooManyFields extends AbstractRule { private Map stats; private Map nodes; - private int maxFields; private static final PropertyDescriptor maxFieldsDescriptor = new IntegerProperty( "maxfields", @@ -36,7 +35,7 @@ public class TooManyFields extends AbstractRule { public Object visit(ASTCompilationUnit node, Object data) { - maxFields = getIntProperty(maxFieldsDescriptor); + int maxFields = getIntProperty(maxFieldsDescriptor); stats = new HashMap(5); nodes = new HashMap(5); diff --git a/pmd/src/net/sourceforge/pmd/rules/junit/AbstractJUnitRule.java b/pmd/src/net/sourceforge/pmd/rules/junit/AbstractJUnitRule.java index 5bba41be56..7b6b5bf461 100644 --- a/pmd/src/net/sourceforge/pmd/rules/junit/AbstractJUnitRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/junit/AbstractJUnitRule.java @@ -35,13 +35,9 @@ public abstract class AbstractJUnitRule extends AbstractRule { } } - private boolean isJunit4Class = false; - - private boolean isJunit3Class = false; - public Object visit(ASTCompilationUnit node, Object data){ - isJunit3Class = isJUnit3Class(node); - isJunit4Class = isJUnit4Class(node); + boolean isJunit3Class = isJUnit3Class(node); + boolean isJunit4Class = isJUnit4Class(node); if(isJunit3Class || isJunit4Class){ return super.visit(node, data); }