Expand var-args before passing to KeyGenerator
Update `CacheAspectSupport` to expand any var-arg parameters before calling `KeyGenerator` implementations. Prior to this commit var-args would be passed to `KeyGenerator` implementations as a nested array, often causing the same key to be generated regardless of the arguments. Issue: SPR-10870
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<cache:cacheable method="conditional" condition="#classField == 3"/>
|
||||
<cache:cacheable method="unless" unless="#result > 10"/>
|
||||
<cache:cacheable method="key" key="#p0"/>
|
||||
<cache:cacheable method="varArgsKey"/>
|
||||
<cache:cacheable method="nam*" key="#root.methodName"/>
|
||||
<cache:cacheable method="rootVars" key="#root.methodName + #root.method.name + #root.targetClass + #root.target"/>
|
||||
<cache:cacheable method="nullValue" cache="default"/>
|
||||
@@ -52,6 +53,7 @@
|
||||
<cache:advice id="cacheAdviceClass" cache-manager="cacheManager" key-generator="keyGenerator">
|
||||
<cache:caching cache="default">
|
||||
<cache:cacheable method="key" key="#p0"/>
|
||||
<cache:cacheable method="varArgsKey"/>
|
||||
<cache:cacheable method="nam*" key="#root.methodName + #root.caches[0].name"/>
|
||||
<cache:cacheable method="rootVars" key="#root.methodName + #root.method.name + #root.targetClass + #root.target"/>
|
||||
<cache:cacheable method="cache"/>
|
||||
|
||||
Reference in New Issue
Block a user