<No Comment Entered>

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@532 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
David Craine
2002-07-26 21:07:55 +00:00
parent f0ac0a75a2
commit 5e3c4e4415

View File

@ -10,7 +10,6 @@ import net.sourceforge.pmd.ast.ASTBlock;
public class UnusedFormalParameterRule extends AbstractRule {
private List paramNames = null;
/**
Skip interfaces
@ -19,27 +18,28 @@ public class UnusedFormalParameterRule extends AbstractRule {
return data;
}
/**
* Check to see if the param names are used in the body of the method
* @param paramNames list of param names to check
*/
private void checkParamNames(HashSet paramNames, SimpleNode startNode) {
}
public Object visit(ASTMethodDeclaration node, Object data) {
if (node.isPrivate()) {
SimpleNode md = (SimpleNode)node.jjtGetChild(1);
SimpleNode formalParams = (SimpleNode)md.jjtGetChild(0);
int paramCount = formalParams.jjtGetNumChildren();
if (paramCount == 0) return data; //bail out if now paramters
paramNames = new ArrayList();
HashSet paramNames = new HashSet();
for (int i=0; i<paramCount; i++) {
ASTName paramName = (ASTName)formalParams.jjtGetChild(i).jjtGetChild(0).jjtGetChild(0);
paramNames.add(paramName);
}
checkParamNames(paramNames, md);
}
return data;
}
public Object visit(ASTBlock node, Object data) {
if (paramNames != null) {
}
return data;
}
}
}