forked from phoedos/pmd
clarified loop
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4970 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user