replaced common Integer creation with numeric constants

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4528 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios
2006-09-23 15:13:06 +00:00
parent 7194d5788a
commit a29621c969
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ package net.sourceforge.pmd.rules;
import net.sourceforge.pmd.ast.ASTCompilationUnit;
import net.sourceforge.pmd.ast.ASTImportDeclaration;
import net.sourceforge.pmd.rules.design.ExcessiveNodeCountRule;
import net.sourceforge.pmd.util.NumericConstants;
/**
* ExcessiveImports attempts to count all unique imports a class
@ -30,6 +31,6 @@ public class ExcessiveImports extends ExcessiveNodeCountRule {
* @return Object
*/
public Object visit(ASTImportDeclaration node, Object data) {
return new Integer(1);
return NumericConstants.ONE;
}
}

View File

@ -5,6 +5,7 @@ package net.sourceforge.pmd.rules.design;
import net.sourceforge.pmd.ast.ASTFormalParameter;
import net.sourceforge.pmd.ast.ASTFormalParameters;
import net.sourceforge.pmd.util.NumericConstants;
/**
* This rule detects an abnormally long parameter list.
@ -19,6 +20,6 @@ public class LongParameterListRule extends ExcessiveNodeCountRule {
// Count these nodes, but no others.
public Object visit(ASTFormalParameter node, Object data) {
return new Integer(1);
return NumericConstants.ONE;
}
}