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:
@ -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();
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
class UnusedFormalParam1 {
|
||||
private void testMethod(String param1) {
|
||||
|
||||
//System.out.println(param1);
|
||||
}
|
||||
|
||||
private native int testNativeMethod(String param1);
|
||||
|
||||
private void t2(){
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user