S6809: add support for @Cacheable

Description

A method annotated with Spring's @Async, @Cacheable or @Transactional annotations will not work as expected
if invoked directly from within its class.

This is because Spring generates a proxy class with wrapper code to manage the method's asynchronicity (@Async), to cache methods invocations (@Cacheable),
or to handle the transaction (@Transactional).
However, when called using this, the proxy instance is bypassed, and the method is invoked directly
without the required wrapper code.

Activity

Tomasz TylendaFebruary 12, 2025 at 4:32 PM

Validated with local SQ and analysis via mvn (didn’t work in the IDE, likely due to caching :P ). Created a project with a function to calculate Fibbonacci numbers (so it’s too slow without caching) and verified that we catch calls, which do not go to a proxy.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Components

Sprint

Fix versions

Priority

Sentry

Created February 3, 2025 at 9:52 AM
Updated February 17, 2025 at 9:57 AM
Resolved February 12, 2025 at 4:32 PM