apache / apache/grails-core

@CacheEvict used to support an array of cache-names as value which is no longer possible

Open
#14,168 2 comments 1 reaction 0 assignees View on GitHub
relates-to: grails-cache
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

If an invocation of a method results in multiple caches to be cleared, the following was possible using v`1.1.8` of this plugin.

`@CacheEvict(value=[StatisticsService.SERVICE_STATISTICS_CACHE, StatisticsService.DETAILED_TRANSFER_STATISTICS_CACHE, StatisticsService.GENERAL_STATISTICS_CACHE], allEntries=true)`

Now it's throwing an exception as the `cacheNameException` is being cast to an `ConstantExpression` (`ConstantExpression cacheNameExpression = (ConstantExpression)ScriptBytecodeAdapter.castToType(annotationNode.getMember("value"), ConstantExpression.class);`)

Contributor guide

Open the contributing guide

Research direction

Start with the cache eviction annotation handling around the ConstantExpression cast in the issue, then compare its behavior with version 1.1.8. Verify that an array supplied through @CacheEvict.value can clear multiple caches with allEntries=true; the payload names no source file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.