Commons IO
  1. Commons IO
  2. IO-335

Tailer#readLines - incorrect CR handling

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      The readLines method checks for CR. If found, it is not stored immediately, but a flag is set.

      If the next char is an LF, the buffer is passed to the listener without the CR.
      As soon as the next non-LF (and non-CR) character is received, the saved CR is written to the buffer.

      The net result is that CR before LF migrates to the start of the next non-empty line, and repeated CRs are collapsed. This is clearly wrong.

      The original code (before IO-274) used RandomAccessFile#readLine() which returns on CR, LF or CRLF.

      It looks as though the intention was to retain this behaviour whilst not blocking.

        Activity

          People

          • Assignee:
            Sebb
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development