Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235792

LineNumberReader.getLineNumber() behavior is inconsistent with respect to EOF

XMLWordPrintable

    • b10
    • generic
    • generic

      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.

        There are no Sub-Tasks for this issue.

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: