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

Invalid synchronization in DefaultXWikiRenderingEngine

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3-milestone-1
    • Fix Version/s: 4.3-milestone-2
    • Component/s: Old Core
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: