[
https://issues.apache.org/jira/browse/WW-5647?focusedWorklogId=1031144&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031144
]
ASF GitHub Bot logged work on WW-5647:
--------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jul/26 18:40
Start Date: 19/Jul/26 18:40
Worklog Time Spent: 10m
Work Description: lukaszlenart commented on PR #1781:
URL: https://github.com/apache/struts/pull/1781#issuecomment-5016928081
LGTM š
Issue Time Tracking
-------------------
Worklog Id: (was: 1031144)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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)