private boolean isNotSafelyClosedResource(PsiExpression expression) {
      if (!isResourceCreation(expression)) {
        return false;
      }
      final PsiVariable boundVariable = getVariable(expression);
      return !(boundVariable instanceof PsiResourceVariable) &&
             !isSafelyClosed(boundVariable, expression) &&
             !isResourceFactoryClosed(expression) &&
             !isResourceEscaping(boundVariable, expression) &&
             !isSafelyClosedResource(expression);
    }
private boolean isNotSafelyClosedResource(PsiExpression expression)