Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Labels:
      None

      Description

      TemplateString is not thread-safe but it is being used concurrently by many cores due to the static instance.

      Currently TemplateString#cache is not synchronized, and static instance of TemplateString is used by VariableResolverImpl#replaceTokens().

        Activity

        Hide
        Noble Paul added a comment - - edited

        making that instance non-static should be fine. right?

        but this is a better solution because across imports this will give better perf

        Show
        Noble Paul added a comment - - edited making that instance non-static should be fine. right? but this is a better solution because across imports this will give better perf
        Hide
        Shalin Shekhar Mangar added a comment -

        I think this is better because even within an import, DocBuilder.getVariableResolver() is called many times.

        Show
        Shalin Shekhar Mangar added a comment - I think this is better because even within an import, DocBuilder.getVariableResolver() is called many times.
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 737771.

        Thanks Ryuuichi!

        I changed the patch to remove putIfAbsent since we cannot save the object creation with or without it.

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 737771. Thanks Ryuuichi! I changed the patch to remove putIfAbsent since we cannot save the object creation with or without it.

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Liu Kumai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development