RFR JDK-8003258: BufferedReader.lines()

Stephen Colebourne scolebourne at joda.org
Fri Apr 26 23:46:49 UTC 2013


I would suggest a new line at the end of each file.

Plus there is some very stylised formatting in terms of making things
align vertically that I wouldn't do personally, and seem to waste a
lot of screen space. Plus a single line which should be three lines.
public void close() { closed = true; }

"Since the {@code Stream} does not necessary consume all lines"
should be
"Since the {@code Stream} does not necessarily consume all lines"

I did a double take when I saw:
 try {
  return nextLine;
 } finally {
  nextLine = null;
 }
Certainly an "interesting" approach to returning and clearing.

Stephen


On 26 April 2013 22:59, Henry Jen <henry.jen at oracle.com> wrote:
> Hi,
>
> Please review webrev at
>
> http://cr.openjdk.java.net/~henryjen/ccc/8003258.1/webrev/
>
> It adds a method to BufferedReader.
>
> public Stream<String> lines() {}
>
> A class java.io.UncheckedIOException is also added as a general approach
> for wrapping up an IOException to be unchecked.
>
> Cheers,
> Henry



More information about the core-libs-dev mailing list