lukaszlenart opened a new pull request, #1933:
URL: https://github.com/apache/struts/pull/1933

   Fixes [WW-5663](https://issues.apache.org/jira/browse/WW-5663)
   
   `DefaultActionInvocation.mergedParams` looked the interceptor mapping up 
*again* by name in `proxy.getConfig().getInterceptors()` — the very list the 
invocation iterates — and merged the first match's params over the mapping's 
own. With a unique name that merged a map into a copy of itself; with a 
repeated name (a stack composed from another stack that already holds the 
interceptor, or a ref repeated with different params) every later invocation 
silently ran with the **first** ref's params. Only `WithLazyParams` 
interceptors are affected — `ActionFileUploadInterceptor` in-tree — so the 
symptom is the wrong upload policy, with no error.
   
   ### Why the lookup existed
   
   It came in with WW-5585 (`939576c1c`, 2025-11-22), written two days after 
WW-5587 was filed: at that point stack-ref params were not stored on the 
`InterceptorMapping` at all, and the lookup was an attempt to fetch them from 
the config list — which could never work, since it was searching the same 
objects. WW-5587 fixed the real cause in 7.2.1 by passing the params into the 
mapping, so nothing has needed the lookup since. The PR carries no other 
rationale for it.
   
   ### Change
   
   `mergedParams` and its WW-5659 explanatory comment are deleted; 
`invokeWithLazyParams` passes `interceptorMapping.getParams()` straight to 
`LazyParamInjector.resolveInto`. No defensive copy — `resolveInto` only 
iterates the map (verified), and the mapping's map is build-time configuration 
nothing writes to at runtime since WW-5659.
   
   Behaviour change: an interceptor-ref name appearing twice in one action's 
resolved list now applies each ref's own params. Present in 7.2.0–7.3.0; no 6.x.
   
   ### Test
   
   
`DefaultActionInvocationTest.testInvokeWithLazyParamsRepeatedRefKeepsEachRefsOwnParams`
 with a new `LazyFooTwice` action in `xwork-sample.xml` referencing `lazy` 
twice (`foo=first`, `foo=second`). RED on `main`: `expected:<second> but 
was:<first>`.
   
   Full `core` suite passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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