clarified loop

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4970 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Wouter Zelle
2007-01-22 21:13:05 +00:00
parent e3c2b25ad5
commit 0b79372cf5

View File

@ -54,7 +54,7 @@ public class CloseResource extends AbstractRule {
protected Map propertiesByName() {
return propertyDescriptorsByName;
};
}
public Object visit(ASTCompilationUnit node, Object data) {
if (closeTargets.isEmpty() && getStringProperty(closeTargetsDescriptor) != null) {
@ -106,7 +106,9 @@ public class CloseResource extends AbstractRule {
String target = id.getImage() + ".close";
Node n = var;
while (!((n = n.jjtGetParent()) instanceof ASTBlock)) ;
while (!(n instanceof ASTBlock)) {
n = n.jjtGetParent();
}
ASTBlock top = (ASTBlock) n;