arunmanni-ai commented on PR #1781:
URL: https://github.com/apache/struts/pull/1781#issuecomment-5002952094

   Hi @lukaszlenart , Addressed both optional follow-ups from your review:
   
   1. **noCache no longer pollutes the shared cache** — `getTemplates()` now 
only calls `templatesCache.put()` when `!noCache`. A `noCache=true` caller 
still recompiles fresh every time (unchanged), it just no longer overwrites the 
cached entry other, cached callers rely on.
   
   2. **Dedup unit test added** — `testConcurrentGetTemplatesCompilesOnce()` 
races two threads through a concurrent miss on the same path and asserts 
`newTemplates()` is invoked exactly once and both threads observe the same 
`Templates` instance.
   
   Also added `testNoCacheDoesNotPollutePersistentCache()` to cover (1) 
directly: compiles once (cached), compiles again with `noCache=true` (different 
instance, proving it recompiles), then confirms a separate `noCache=false` 
caller still gets the original cached instance back.
   
   Full suite: `mvn -pl plugins/xslt -am test -Dtest=XSLTResultTest`→ 17/17 
passing (15 existing + 2 new).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to