forked from phoedos/pmd
replaced getImage().equals with utility method hasImageEqualTo (cleaner & handles nulls)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4694 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -38,7 +38,7 @@ public abstract class AbstractSunSecureRule extends AbstractRule {
|
||||
for (Iterator it = fds.iterator(); it.hasNext();) {
|
||||
final ASTFieldDeclaration fd = (ASTFieldDeclaration) it.next();
|
||||
final ASTVariableDeclaratorId vid = (ASTVariableDeclaratorId) fd.getFirstChildOfType(ASTVariableDeclaratorId.class);
|
||||
if (vid != null && vid.getImage().equals(varName)) {
|
||||
if (vid != null && vid.hasImageEqualTo(varName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -81,7 +81,7 @@ public abstract class AbstractSunSecureRule extends AbstractRule {
|
||||
for (Iterator it = lvars.iterator(); it.hasNext();) {
|
||||
final ASTLocalVariableDeclaration lvd = (ASTLocalVariableDeclaration) it.next();
|
||||
final ASTVariableDeclaratorId vid = (ASTVariableDeclaratorId) lvd.getFirstChildOfType(ASTVariableDeclaratorId.class);
|
||||
if (vid != null && vid.getImage().equals(vn)) {
|
||||
if (vid != null && vid.hasImageEqualTo(vn)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user