Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A4F56200B9C for ; Mon, 26 Sep 2016 06:02:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9E8EC160AE2; Mon, 26 Sep 2016 04:02:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1902F160ACE for ; Mon, 26 Sep 2016 06:02:22 +0200 (CEST) Received: (qmail 20019 invoked by uid 500); 26 Sep 2016 04:02:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 20008 invoked by uid 99); 26 Sep 2016 04:02:22 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2016 04:02:22 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C8DB52C0B04 for ; Mon, 26 Sep 2016 04:02:21 +0000 (UTC) Date: Mon, 26 Sep 2016 04:02:21 +0000 (UTC) From: "Prateek Rungta (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CSV-197) CSVParser doesn't close the underlying handle after iteration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 26 Sep 2016 04:02:23 -0000 [ https://issues.apache.org/jira/browse/CSV-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15521968#comment-15521968 ] Prateek Rungta commented on CSV-197: ------------------------------------ Yep, that's what I did once I found the leak. I didn't initially, expecting an Iterable to close the underlying handle. That said, I don't know if it's any clearer than expecting users to maintain the lifecycle themselves. > CSVParser doesn't close the underlying handle after iteration > ------------------------------------------------------------- > > Key: CSV-197 > URL: https://issues.apache.org/jira/browse/CSV-197 > Project: Commons CSV > Issue Type: Bug > Components: Parser > Reporter: Prateek Rungta > Priority: Minor > Fix For: Patch Needed, Discussion, 1.4.1 > > > The following code leaks file handles: > {code} > CSVParser parser = // setup parser > for (CSVRecord rec: parser) { > } > // leak > {code} > I'd expect the underlying iterator to close() if it's finished iterating. -- This message was sent by Atlassian JIRA (v6.3.4#6332)