<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:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user