You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/01/18 20:43:00 UTC

[jira] [Resolved] (IO-685) LineReader to implement AutoCloseable

     [ https://issues.apache.org/jira/browse/IO-685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved IO-685.
--------------------------------
    Fix Version/s:     (was: 3.x)
       Resolution: Fixed

[~andrear]

I am marking this ticket as resolved as {{LineIterator}} implements {{Closable}}.

Please verify git master for your use case and close this ticket if all is well for you.

 

> LineReader to implement AutoCloseable
> -------------------------------------
>
>                 Key: IO-685
>                 URL: https://issues.apache.org/jira/browse/IO-685
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.7
>            Reporter: Andrea Rombaldi
>            Priority: Minor
>             Fix For: 2.9.0
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> org.apache.commons.io.LineReader should implement the AutoCloseable interface in order to allow the use of try-with-resources statement such as in the following example:
> {{try (final LineIterator itr = new LineIterator(new FileReader("c:/temp/readme.txt"))) {}}
>  {{  while (itr.hasNext()) {}}
>  {{    System.out.println(itr.next());}}
>     }
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)