Details
-
Bug
-
Resolution: Fixed
-
Major
-
4.3-milestone-1
-
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) { // [...]