Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-13973

Regex in DefaultWysiwygConverter may impact performance

XMLWordPrintable

      A regular expression run at the end of the DefaultWysiwygConverter, over the entire markup produced, may hamper performance:
      The suspected regular expression call is this one:

      s.replaceAll("((\\s)? (?:[\\s&&[^\\n]])?)+(\\n|$)", "$2$3")
      

      Introduced while addressing CONF-5928

      This can lead to stacktraces that look like the following but much longer:

      @40000000493f538f2cba6aa4 	at java.util.regex.Pattern$Slice.match(Pattern.java:3807)
      @40000000493f538f2cba6e8c 	at java.util.regex.Pattern$Dummy.match(Pattern.java:2993)
      @40000000493f538f2cba9984 	at java.util.regex.Pattern$Branch.match(Pattern.java:4535)
      @40000000493f538f2cbaa154 	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4575)
      @40000000493f538f2cbaa924 	at java.util.regex.Pattern$Loop.match(Pattern.java:4702)
      @40000000493f538f2cbad034 	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4634)
      @40000000493f538f2cbad804 	at java.util.regex.Pattern$Dummy.match(Pattern.java:2993)
      @40000000493f538f2cbadfd4 	at java.util.regex.Pattern$Branch.match(Pattern.java:4535)
      @40000000493f538f2cbb0acc 	at java.util.regex.Pattern$Slice.match(Pattern.java:3807)
      @40000000493f538f2cbb0eb4 	at java.util.regex.Pattern$Dummy.match(Pattern.java:2993)
      @40000000493f538f2cbb39ac 	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4634)
      @40000000493f538f2cbb417c 	at java.util.regex.Pattern$Ctype.match(Pattern.java:3538)
      @40000000493f538f2cbb494c 	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4575)
      @40000000493f538f2cbb83e4 	at java.util.regex.Pattern$Branch.match(Pattern.java:4535)
      @40000000493f538f2cbb8bb4 	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4575)
      @40000000493f538f2cbbb6ac 	at java.util.regex.Pattern$Loop.matchInit(Pattern.java:4718)
      @40000000493f538f2cbbba94 	at java.util.regex.Pattern$Prolog.match(Pattern.java:4658)
      @40000000493f538f2cbbe58c 	at java.util.regex.Pattern$Start.match(Pattern.java:3019)
      @40000000493f538f2cbbed5c 	at java.util.regex.Matcher.search(Matcher.java:1092)
      @40000000493f538f2cbc1854 	at java.util.regex.Matcher.find(Matcher.java:528)
      @40000000493f538f2cbc1c3c 	at java.util.regex.Matcher.replaceAll(Matcher.java:802)
      @40000000493f538f2cbc4734 	at java.lang.String.replaceAll(String.java:2000)
      @40000000493f538f2cbc7de4 	at com.atlassian.renderer.wysiwyg.DefaultWysiwygConverter.convertXHtmlToWikiMarkup(DefaultWysiwygConverter.java:809)
      

              Unassigned Unassigned
              don.willis@atlassian.com Don Willis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: