mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8235668: LineNumberReader#getLineNumber() returns wrong line number (one fewer) in Lucene test
Reviewed-by: alanb, rriggs
This commit is contained in:
parent
dbd4134c04
commit
7cdecd8981
3 changed files with 8 additions and 65 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
package java.io;
|
||||
|
||||
|
||||
/**
|
||||
* A buffered character-input stream that keeps track of line numbers. This
|
||||
* class defines methods {@link #setLineNumber(int)} and {@link
|
||||
|
@ -199,10 +200,9 @@ public class LineNumberReader extends BufferedReader {
|
|||
*/
|
||||
public String readLine() throws IOException {
|
||||
synchronized (lock) {
|
||||
boolean[] term = new boolean[1];
|
||||
String l = super.readLine(skipLF, term);
|
||||
String l = super.readLine(skipLF);
|
||||
skipLF = false;
|
||||
if (l != null && term[0])
|
||||
if (l != null)
|
||||
lineNumber++;
|
||||
return l;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue