JBehave
  1. JBehave
  2. JBEHAVE-242

Regex Stackoverflow error with ExampleTables on Windows

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.4, 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows
    • Number of attachments :
      0

      Description

      Regex Stackoverflow error with ExampleTables on Windows, which partially originate from a JDK bug (StackOverflow with regex alternation like (.|\s)* ). The fix that works for me:

      // Avoid alternation by using DOTALL and .* instead of (.|\s)*
      PatternScenarioParser.java
      private Pattern patternToPullScenarioTableIntoGroupOne() {
      KeyWords keywords = configuration.keywords();
      String table = keywords.examplesTable();
      return compile("."table"
      s
      (.*)", DOTALL);
      }

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 2.5 [ 15850 ]
        Hide
        Mauro Talevi added a comment - - edited

        Applied, thanks!

        It passes all examples. I'll deploy a snapshot tomorrow and we'll see if it has any other side effect.

        Show
        Mauro Talevi added a comment - - edited Applied, thanks! It passes all examples. I'll deploy a snapshot tomorrow and we'll see if it has any other side effect.
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Michael Zimmermann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: