Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2ECF10DDF for ; Tue, 29 Apr 2014 07:15:36 +0000 (UTC) Received: (qmail 27899 invoked by uid 500); 29 Apr 2014 07:15:32 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 27445 invoked by uid 500); 29 Apr 2014 07:15:26 -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 26941 invoked by uid 99); 29 Apr 2014 07:15:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 07:15:18 +0000 Date: Tue, 29 Apr 2014 07:15:18 +0000 (UTC) From: "Hannes H. (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IO-441) LineIterator should call close on itself when hasNext() returns false. (was IO-123) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Hannes H. created IO-441: ---------------------------- Summary: LineIterator should call close on itself when hasNext() returns false. (was IO-123) Key: IO-441 URL: https://issues.apache.org/jira/browse/IO-441 Project: Commons IO Issue Type: Improvement Components: Utilities Reporter: Hannes H. Priority: Minor As in IO-123 described the LineIterator should call close when hasNext() returns false. One mentioned reason against this behavior was the fact, that in case of a thrown Exception in the code block under the Iterator will never be closed. In my opinion this argumentation is not valid, because in the current implementation the developer as well needs to take care to close the iterator in case of an Exception, so the responsibility does not change. To not brake existing implementations I suggest to overload the methods with an additional boolean argument which enables an auto-close. I know, one should read the documentation before using a library, but in my opinion the current behavior - not closing when hasNext() returns false - is not expected at all, at least for me. -- This message was sent by Atlassian JIRA (v6.2#6252)