Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2659

info.magnolia.cms.beans.config.RegexpVirtualURIMapping error with high number of groups

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.1
    • None
    • core
    • None

      I found that using a regexp with a high number of groups (>10) in a RegexpVirtualURIMapping can cause a problem when replacing group instances with matches.

      if you change
      int matcherCount = matcher.groupCount();
      for (int j = 0; j <= matcherCount; j++) {

      in
      int matcherCount = matcher.groupCount();
      for (int j = matcherCount; j >= 0; j--){

      it works.

      This problem happens because the procedure replaces (in example) all "$2" occurrences making impossible to find (and replace) the "$20"

        Acceptance criteria

              gjoseph Magnolia International
              manuelmolaschi Manuel Molaschi
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD