You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A function that invalidates a cache with an @CacheKey annotation is only working as expected, if the parameters of the function are in the correct order.
There are two problems here that I can see.
The cache invalidator seems to not ignore the values without a @CacheKey annotation for the Key generation
The cache invalidator depends on the order of all @CacheKey parameters
Expected behavior
All invalidation functions of the TestClass in the Reproducer should actually invalidate the cache for the cached function.
This should not depend on order of parameters, neither if the are non-@CacheKey parameters nor if there are only @CacheKey parameters (or @CacheKey completely missing).
Actual behavior
testChangedOrder() and testChangedOrderWithNonCacheKey() are not working because the cache is not invalidated.
To Reproduce
I have the following Class inside my Application:
So I checked the code and that's a normal behavior considering how it's done. Only the parameter positions are taken into account and they are iterated in order. We don't consider the parameter names at all.
Given we consider compiling with -parameters mandatory with Quarkus, that might be doable but I'm not entirely sure it's worth the added complexity.
In any case, we should probably document it properly.
Hi @BiggA94 and sorry for the late answer. As explained by @gsmet, the current cache key building logic is based on the parameters positions only and not on their names. But this should not cause testChangedOrderWithNonCacheKey to fail so I suspect there's something fishy going on in the cache extension code. I'll check that right away.
Describe the bug
A function that invalidates a cache with an
@CacheKey
annotation is only working as expected, if the parameters of the function are in the correct order.There are two problems here that I can see.
@CacheKey
annotation for the Key generation@CacheKey
parametersExpected behavior
All invalidation functions of the TestClass in the Reproducer should actually invalidate the cache for the cached function.
This should not depend on order of parameters, neither if the are non-
@CacheKey
parameters nor if there are only@CacheKey
parameters (or@CacheKey
completely missing).Actual behavior
testChangedOrder() and testChangedOrderWithNonCacheKey() are not working because the cache is not invalidated.
To Reproduce
I have the following Class inside my Application:
And the following test:
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
java -version
:1.5.2.Final
mvnw --version
orgradlew --version
):The text was updated successfully, but these errors were encountered: