hg: lambda/lambda/jdk: Add BufferedReader.lines
Remi Forax
forax at univ-mlv.fr
Sun Nov 11 15:17:23 PST 2012
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.
I agree that a runtime exception is better than an Error, but given that
some classes of the JDK already uses IOError exactly for the same
purpose, I don't think it's a good idea to have two classes for the very
same thing.
Rémi
More information about the lambda-dev
mailing list