[
https://issues.apache.org/jira/browse/WW-5647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lukasz Lenart resolved WW-5647.
-------------------------------
Resolution: Fixed
> 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
> Priority: Minor
> Fix For: 7.3.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> 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)