< prev index next >
src/java.base/share/classes/java/io/BufferedReader.java
Print this page
rev 16921 : 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
@@ -1,7 +1,7 @@
/*
- * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -295,18 +295,19 @@
}
}
/**
* 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()
*
* @exception IOException If an I/O error occurs
*/
@@ -373,16 +374,16 @@
}
}
/**
* 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
*
* @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
*
* @see java.nio.file.Files#readAllLines
*/
< prev index next >