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 2020/09/10 15:34:00 UTC

[jira] [Updated] (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 updated IO-685:
-------------------------------
    Fix Version/s:     (was: 2.8.0)
                   2.9.0

> 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: 3.x, 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)