From 368d4013aa440d9aa6208bbd67e5889e84347973 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Tue, 4 Mar 2003 15:43:56 +0000 Subject: [PATCH] Latest code from Andrew Glover git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1501 51baf565-9d33-0410-a72c-fc3788e3496d --- .../sourceforge/pmd/rules/ExcessivePublicCountRule.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pmd/src/net/sourceforge/pmd/rules/ExcessivePublicCountRule.java b/pmd/src/net/sourceforge/pmd/rules/ExcessivePublicCountRule.java index dc70f77b51..926c98f338 100644 --- a/pmd/src/net/sourceforge/pmd/rules/ExcessivePublicCountRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/ExcessivePublicCountRule.java @@ -33,10 +33,15 @@ public class ExcessivePublicCountRule extends ExcessiveNodeCountRule { return this.getTallyOnAccessType((AccessNode)node.jjtGetParent()); } /** - * Method counts ONLY public class attributes + * Method counts ONLY public class attributes which are not PUBLIC and + * static- these usually represent constants.... */ public Object visit(ASTFieldDeclaration node, Object data) { - return this.getTallyOnAccessType(node); + if(node.isFinal() && node.isStatic()){ + return new Integer(0); + }else{ + return this.getTallyOnAccessType(node); + } } /** * Method counts a node if it is public