commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne (JIRA)" <j...@apache.org>
Subject [jira] Commented: (IO-123) LineIterator should call close on itself when hasNext() returns false.
Date Tue, 19 Jun 2007 23:52:26 GMT

    [ https://issues.apache.org/jira/browse/IO-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506338
] 

Stephen Colebourne commented on IO-123:
---------------------------------------

Unfortunately, if the block of code within the loop throws an exception, then the file isn't
closed.

> LineIterator should call close on itself when hasNext() returns false.
> ----------------------------------------------------------------------
>
>                 Key: IO-123
>                 URL: https://issues.apache.org/jira/browse/IO-123
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 1.3.1
>            Reporter: Dalibor Novak
>            Priority: Minor
>             Fix For: 1.3.2
>
>
> LineIterator should call close on itself when hasNext() returns false. This would enable
us to write something like this:
> for (LineIterator lit = FileUtils.lineIterator(csvFile); lit.hasNext(); )
> {
>     //do something
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message