Fixed bug when checking native methods

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@545 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
David Craine
2002-07-29 15:48:59 +00:00
parent 6e7abaa671
commit 270c684fcf
2 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,7 @@ public class UnusedFormalParameterRule extends AbstractRule {
}
public Object visit(ASTMethodDeclaration node, Object data) {
if (node.isPrivate()) {
if (node.isPrivate() && ! node.isNative()) { //make sure it's a private method and not a native method
SimpleNode md = (SimpleNode)node.jjtGetChild(1);
SimpleNode formalParams = (SimpleNode)md.jjtGetChild(0);
int paramCount = formalParams.jjtGetNumChildren();

View File

@ -2,9 +2,11 @@
class UnusedFormalParam1 {
private void testMethod(String param1) {
//System.out.println(param1);
}
private native int testNativeMethod(String param1);
private void t2(){
}