Skip to content

WW-5647 Use ConcurrentHashMap for XSLT template cache#1781

Open
arunmanni-ai wants to merge 1 commit into
apache:mainfrom
arunmanni-ai:fix-xslt-template-cache-thread-safety
Open

WW-5647 Use ConcurrentHashMap for XSLT template cache#1781
arunmanni-ai wants to merge 1 commit into
apache:mainfrom
arunmanni-ai:fix-xslt-template-cache-thread-safety

Conversation

@arunmanni-ai

Copy link
Copy Markdown
Contributor

The XSLT template cache in XSLTResult uses a plain HashMap with an
unsynchronized get() outside the synchronized block. This can produce
stale reads or internal corruption under concurrent access.

This patch:

  • Replaces HashMap with ConcurrentHashMap for thread-safe reads
  • Adds double-check inside the synchronized block to avoid
    redundant template compilation
  • Removes the static initializer in favour of inline initialization

@arunmanni-ai arunmanni-ai changed the title Use ConcurrentHashMap for XSLT template cache WW-5647 Use ConcurrentHashMap for XSLT template cache Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant