JDK-8235792 : LineNumberReader.getLineNumber() behavior is inconsistent with respect to EOF
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-12-11
  • Updated: 2020-08-11
  • Resolved: 2020-08-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b10Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Sub Tasks
JDK-8260874 :  
Description
As described in JDK-8230342, the results of getLineNumber() were inconsistent after reaching EOF depending on the methods used to read. The fix for JDK-8230342, although correct per the specification of LineNumberReader, however caused unexpected behavior for a typical use case of getLineNumber() such as described in JDK-8235668 thereby breaking existing code. Consistency of behavior with respect to EOF should instead be achieved without breaking such code. This might for example be possible by modifying the specification of LineNumberReader to state that the line number is also incremented at EOF, perhaps only provided a line terminator is not that last entity prior to the EOF.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/bc6a10bc5090 User: bpb Date: 2020-08-05 18:54:18 +0000
05-08-2020