forked from phoedos/pmd
PMD on PMD: UseCollectionIsEmpty
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4753 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -378,7 +378,7 @@ public final class ConstructorCallsOverridableMethod extends AbstractRule {
|
||||
m_Eci = eci;
|
||||
List l = new ArrayList();
|
||||
eci.findChildrenOfType(ASTArguments.class, l);
|
||||
if (l.size() > 0) {
|
||||
if (!l.isEmpty()) {
|
||||
ASTArguments aa = (ASTArguments) l.get(0);
|
||||
count = aa.getArgumentCount();
|
||||
}
|
||||
@ -854,7 +854,7 @@ public final class ConstructorCallsOverridableMethod extends AbstractRule {
|
||||
//if this list does not contain our class name, then its not referencing our class
|
||||
//this is a cheezy test... but it errs on the side of less false hits.
|
||||
List packClass = meth.getQualifierNames();
|
||||
if (packClass.size() > 0) {
|
||||
if (!packClass.isEmpty()) {
|
||||
for (Iterator it = packClass.iterator(); it.hasNext();) {
|
||||
String name = (String) it.next();
|
||||
if (name.equals(className)) {
|
||||
|
@ -36,7 +36,7 @@ public class AbstractOptimizationRule extends AbstractRule implements Rule {
|
||||
// TODO - symbol table?
|
||||
protected final String getVarName(ASTLocalVariableDeclaration node) {
|
||||
List l = node.findChildrenOfType(ASTVariableDeclaratorId.class);
|
||||
if (l != null && l.size() > 0) {
|
||||
if (l != null && !l.isEmpty()) {
|
||||
ASTVariableDeclaratorId vd = (ASTVariableDeclaratorId) l.get(0);
|
||||
return vd.getImage();
|
||||
}
|
||||
|
@ -100,6 +100,6 @@ public class ExceptionSignatureDeclaration extends AbstractRule {
|
||||
}
|
||||
|
||||
private boolean hasContent(List nameList) {
|
||||
return nameList != null && nameList.size() > 0;
|
||||
return nameList != null && !nameList.isEmpty();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user