JBehave
  1. JBehave
  2. JBEHAVE-924

PatternVariableBuilder can be extremely inefficient in some cases

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.x
    • Fix Version/s: 3.9
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      When org.jbehave.core.steps.PatternVariantBuilder#variantsFor is called, the following regex is used -

       "(.*?)?(\\{((.*?)(\\|)?)*?\\})(.*)"

      .
      Matching with this regex can be very lengthy and CPU intensive when there is an unmatched curly bracket for example, like here:

      create entity of type $entityType {set properties $propertyNames to values $propertyValues

        Activity

        Hide
        Victor Rosenberg added a comment -

        I've created pull requests for this issue on github.

        Show
        Victor Rosenberg added a comment - I've created pull requests for this issue on github.
        Mauro Talevi made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Fix Version/s 3.9 [ 19035 ]
        Hide
        Mauro Talevi added a comment -

        Pulled with thanks.

        Show
        Mauro Talevi added a comment - Pulled with thanks.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Victor Rosenberg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: