Latest code from Andrew Glover

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1501 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-03-04 15:43:56 +00:00
parent afd5426dd7
commit 368d4013aa

View File

@ -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