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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 14
    • 16
    • core-libs
    • b10
    • generic
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: