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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 16
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b10
    • CPU:
      generic
    • OS:
      generic

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: