WW-5587 fix(core): preserve parameters in InterceptorMapping for WithLazyParams interceptors #1416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Summary
Fixes WW-5587 -
WithLazyParamsinterceptors lose parameters in stack configurations.This is a critical bug fix that completes the work started in WW-5586. Even after WW-5586's fix,
WithLazyParamsinterceptors still couldn't work properly in stack configurations because the parameter map wasn't being preserved inInterceptorMapping.Problem
In
InterceptorBuilder.constructParameterizedInterceptorReferences()at line 177, the code was creatingInterceptorMappinginstances using the 2-argument constructor:This constructor defaults to an empty params map, which breaks the lazy parameter injection mechanism:
LazyParamInjector.injectParams()needs the params map to re-evaluate expressions ❌interceptorMapping.getParams()returns empty → nothing to re-evaluate ❌${someValue}stay as literal strings ❌Solution
Pass the
mapparameter to the 3-argument constructor:This simple one-line change ensures the params map is preserved for
LazyParamInjectorto use during action invocation.Changes
mapparameter toInterceptorMappingconstructorInterceptorMappingTest Coverage
Enhanced existing test
testInvokeWithLazyParamsStackConfiguration()to assert that:WithLazyParamsinterceptors have non-empty params inInterceptorMappingTest passes successfully ✅
Related Issues
Impact
This fix enables the complete dual initialization pattern for
WithLazyParamsinterceptors:Without this fix,
WithLazyParamsinterceptors cannot be used with parameter overrides in interceptor stacks.🤖 Generated with Claude Code