micronaut-projects / micronaut-projects/micronaut-cache

@Slf4j breaks with cache annotations

Open
#655 2 comments 0 reactions 0 assignees View on GitHub
info: workaround available lang: groovy
Dominant language
PLSQL
Stars
32
Forks
36
Avg merge
2h 2m
Merged PRs (30d)
5

Description

### Expected Behavior

the @Slf4j log property to be available in all parts of a class that features cache-related annotations

### Actual Behaviour

the @SLF4J log property is sometimes not found in methods that belong to classes that feature cache-related annotations

### Steps To Reproduce

1. run [cache-log-bug.zip](https://github.com/micronaut-projects/micronaut-cache/files/12442281/cache-log-bug.zip)
2. observe the error message: `groovy.lang.MissingPropertyException: No such property: log for class: com.example.$MyCachedClass$Definition$Intercepted` - either by running the unit tests, or by calling the GET APIs featured in MyController.

( NOTE: this seems to occur for other annotations like @CacheInvalidate as well - not just @Cacheable )

### Environment Information

Operating System: MacOS Ventura, Version 13.4
JDK Version: Coretto 17

### Example Application

see above

### Version

4.0.5

Contributor guide

Open the contributing guide

Research direction

Start with the linked cache-log-bug.zip and reproduce the failure through its unit tests or the GET APIs in MyController. Investigate how cache-related annotations generate the intercepted class and compare that with @Slf4j property availability. Done means log is available in methods using @Cacheable and @CacheInvalidate without MissingPropertyException.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.