Arun Manni created WW-5647:
------------------------------
Summary: Use ConcurrentHashMap for XSLT template cache
Key: WW-5647
URL: https://issues.apache.org/jira/browse/WW-5647
Project: Struts 2
Issue Type: Improvement
Components: Plugin - XSLT
Affects Versions: 7.2.1
Reporter: Arun Manni
The XSLT template cache in XSLTResult uses a plain HashMap with an
unsynchronized get() outside the synchronized block. Under concurrent
access this can produce stale reads or exceptions from internal
HashMap corruption.
This patch replaces HashMap with ConcurrentHashMap for thread-safe
reads, adds a double-check inside the synchronized block to avoid
redundant template compilation, and removes the static initializer
in favour of inline initialization.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)