From f0600f792278f8ba94f20fc2a5486af3e8ba8e2a Mon Sep 17 00:00:00 2001 From: Wouter Zelle Date: Fri, 19 Oct 2007 08:03:45 +0000 Subject: [PATCH] SingularField violations fixed git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5558 51baf565-9d33-0410-a72c-fc3788e3496d --- .../net/sourceforge/pmd/rules/design/TooManyFields.java | 3 +-- .../sourceforge/pmd/rules/junit/AbstractJUnitRule.java | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) 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); }