Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8368

Invalid synchronization in DefaultXWikiRenderingEngine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.3-milestone-2
    • 4.3-milestone-1
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      This code in DefaultXWikiRenderingEngine looks wrong. An instance which will not be visible to any other thread is used for synchronization. Interning the string would work, but I guess that would waste lots of memory.

          private String getKey(String text, XWikiDocument contentdoc, XWikiDocument includingdoc, XWikiContext context)
          {
      
              // [...]
      
              return db + "-" + cdoc + "-" + idoc + "-" + qs + "-" + action + "-" + lang + "-" + text.hashCode();
          }
      
      
          private String renderText(String text, boolean onlyInterpret, XWikiDocument contentdoc, XWikiDocument includingdoc,
              XWikiContext context)
          {
              String key = getKey(text, contentdoc, includingdoc, context);
      
              // [...]
      
              synchronized (key) {
                  // [...]
      

      Attachments

        Activity

          People

            aj Andreas Jonsson
            aj Andreas Jonsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: