Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-223

Decouple end-of-line detection in LineBreaker from OS

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: Core
    • Labels:
      None
    • Flags:
      Patch

      Description

      To my knowledge, all proper text formats accepts "\r\n" as a single line terminator upon input, regardless of the operating system a parser is run on. The difference about line terminators usually only manifests itself when it comes to writing text. Hence, LineBreaker should not try to detect a Win box but check for the char sequence "\r\n".

      If you insist on OS-based behaviour, Os.isFamily( Os.FAMILY_WINDOWS ) from plexus-utils should be used and its return value should be cached in an instance variable of LineBreaker instead of querying the system property "os.name" for every single character.

        Attachments

        1. end-of-line.patch
          0.9 kB
          Benjamin Bentmann

          Activity

            People

            • Assignee:
              ltheussl Lukas Theussl
              Reporter:
              bentmann Benjamin Bentmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: