hg: lambda/lambda/jdk: Add BufferedReader.lines

Remi Forax forax at univ-mlv.fr
Mon Nov 12 07:59:58 PST 2012


On 11/12/2012 12:45 AM, David Holmes wrote:
> On 12/11/2012 9:17 AM, Remi Forax wrote:
>> On 11/12/2012 12:11 AM, Brian Goetz wrote:
>>>> Brian,
>>>> UncheckedIOException already exists, it's IOError.
>>>
>>> That exists, but is something different.
>>>
>>> IOError implements Error, which is intended to indicate an error
>>> situation from which the VM cannot recover.  It was added to support
>>> Console, for which using Error is arguably OK.  But here, an
>>> IOException is clearly NOT an Error.
>>>
>>> Our choices where creating this class or wrapping it in an ordinary
>>> RuntimeException.  Because we anticipated other cases with IO-backed
>>> streams, we thought we'd get additional mileage out of this class.
>>
>> by example, java.nio.file.Files.newDirectoryStream uses IOError exactly
>> for that.
>
> It does? The only use of IOError I can see in java.nio.file.* is in 
> the Path interface. newDirectoryStream throws IOException.

My bad, the implementation was changed at the end of the development of 
jdk7 and
I forget to update my brain accordingly.

DirectoryStream now uses a DirectoryIteratorException which wraps an 
IOException and extends ConcurrentModificationException.
So I supose that UncheckedIOException should be renamed to 
IOIteratorException, should extend ConcurrentModificationException
and be the new supertype of DirectoryIteratorException.

>
> David

Rémi



More information about the lambda-dev mailing list