private static boolean resourceVariablesUsedInFinally(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;
  }
private static boolean resourceVariablesUsedInFinally(PsiStatement[] statements,
                                                        BitSet closedVariableStatementIndices,
                                                        Set<PsiVariable> resourceVariables)