8177526: BufferedReader readLine() javadoc does not match the implementation regarding EOF
Summary: Improve the verbiage of the method and return value descriptions
Reviewed-by: lancea, smarks
--- a/jdk/src/java.base/share/classes/java/io/BufferedReader.java Mon Apr 03 12:54:43 2017 +0100
+++ b/jdk/src/java.base/share/classes/java/io/BufferedReader.java Mon Apr 03 16:40:49 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -297,14 +297,15 @@
/**
* Reads a line of text. A line is considered to be terminated by any one
- * of a line feed ('\n'), a carriage return ('\r'), or a carriage return
- * followed immediately by a linefeed.
+ * of a line feed ('\n'), a carriage return ('\r'), a carriage return
+ * followed immediately by a line feed, or by reaching the end-of-file
+ * (EOF).
*
* @param ignoreLF If true, the next '\n' will be skipped
*
* @return A String containing the contents of the line, not including
* any line-termination characters, or null if the end of the
- * stream has been reached
+ * stream has been reached without reading any characters
*
* @see java.io.LineNumberReader#readLine()
*
@@ -375,12 +376,13 @@
/**
* Reads a line of text. A line is considered to be terminated by any one
- * of a line feed ('\n'), a carriage return ('\r'), or a carriage return
- * followed immediately by a linefeed.
+ * of a line feed ('\n'), a carriage return ('\r'), a carriage return
+ * followed immediately by a line feed, or by reaching the end-of-file
+ * (EOF).
*
* @return A String containing the contents of the line, not including
* any line-termination characters, or null if the end of the
- * stream has been reached
+ * stream has been reached without reading any characters
*
* @exception IOException If an I/O error occurs
*