RFR: JDK-8006884: (fs) Add Files.list, lines and find
henry.jen at oracle.com
Thu May 2 15:58:14 UTC 2013
On May 2, 2013, at 8:52 AM, Henry Jen <henry.jen at oracle.com> wrote:
> On May 2, 2013, at 8:22 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>> On 02/05/2013 07:52, Henry Jen wrote:
>>> Please review a couple stream access API proposed for
>>> java.nio.file.Files and java.nio.file.DirectoryStream,
>> One corner case that I meant to ask about is the expected behavior when someone attempts to do something on a CloseableStream after it is closed? It's not specified so it's not testable but I'm just wondering if the Iterator throwing ISE is right or whether this should be an UncheckedIOException. As I understand it, an ISE will be thrown if someone attempts to use a stream that already been operated on, so this really just leaves the uninteresting case where the stream is closed before using it.
> I think UncheckedIOException is expected as read on a closed InputStream should throw IOException.
> A related question, what do we expect when iterate a DirectoryStream which is closed after we obtain the iterator?
Answer myself, as end of stream expected.
More information about the core-libs-dev