JBehave
  1. JBehave
  2. JBEHAVE-896

ExamplesTable incorrectly parses files with windows line endings

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7.5
    • Fix Version/s: 3.8
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      ExamplesTable uses "\n" as a separator when splitting the table into rows:

      private static final String ROW_SEPARATOR = "\n";

      private void parseByRows(...) {
      String[] rows = tableAsString.split(ROW_SEPARATOR);

      In a file with windows line endings, this leaves a trailing "\r" which is then interpreted as an extra blank column.

      Suggested fix is to use the regex "\\r\\n|\\r|
      n" to split.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.7.6 [ 19035 ]
        Mauro Talevi made changes -
        Fix Version/s 3.8 [ 19104 ]
        Fix Version/s 3.7.6 [ 19035 ]
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Mauro Talevi added a comment -

        Pushed a fix. Can you please test snapshot works for you?

        Show
        Mauro Talevi added a comment - Pushed a fix. Can you please test snapshot works for you?
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Emily Middleton
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: