Uploaded image for project: 'Magnolia Diff Module'
  1. Magnolia Diff Module
  2. MGNLDIFF-15

java.lang.IndexOutOfBoundsException When Content Contains Dollar Sign ($)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.0.4, 1.1.2
    • 1.0.3, 1.1, 1.1.1
    • None
    • Magnolia 4.4.4 and Magnolia 4.5

      When using "Compare with previous" link in the "Edit Workitem" dialog an error is thrown stating: java.lang.IndexOutOfBoundsException: No group 6

      This is appears to be related to there being a $ dollar sign in the content of the versions being compared. Removing the dollar sign allows comparison page to render.

      The stack trace is (for version 1.0.3, similar but different exception in newer version):

      java.lang.IndexOutOfBoundsException: No group 6
      java.util.regex.Matcher.group(Matcher.java:470)
      java.util.regex.Matcher.appendReplacement(Matcher.java:737)
      java.util.regex.Matcher.replaceFirst(Matcher.java:861)
      java.lang.String.replaceFirst(String.java:2146)
      info.magnolia.module.diff.VersionDiffHtmlGenerator.diff(VersionDiffHtmlGenerator.java:81)
      info.magnolia.module.diff.VersionDiffHtmlServlet.getVersionDiffHtml(VersionDiffHtmlServlet.java:171)
      info.magnolia.module.diff.VersionDiffHtmlServlet.doGet(VersionDiffHtmlServlet.java:96)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

      Additional Info: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325587
      I have tried this with both Java 1.5 and 1.6 with the same results.

      Steps to reproduce:

      Go to http://demo.magnolia-cms.com
      Open demo-project/service page
      Edit the "Internal Page Teaser" by adding a $ to the "Teaser Overwrite" text
      Activate changes
      Open and edit the same page again
      Submit the activation for approval
      Use the "Compare with previous" link on the "Edit Workitem" dialog
      See the error

        Acceptance criteria

              ochytil Ondrej Chytil
              adam.galloway Adam Galloway
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD