boolean (PsiStatement[] statements, BitSet closedVariableStatementIndices, Set<PsiVariable> resourceVariables) { for (int i = 0; i < statements.length; i++) { if (!closedVariableStatementIndices.get(i)) { Set<PsiVariable> usedVariables = VariableAccessUtils.collectUsedVariables(statements[i]); for (PsiVariable usedVariable : usedVariables) { if (resourceVariables.contains(usedVariable)) { return true; } } } } return false; }