Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when annotated methods are self-invocated from within its own class #1193

Open
MahatmaFatalError opened this issue Feb 21, 2024 · 0 comments
Milestone

Comments

@MahatmaFatalError
Copy link

Expected Behavior

Given the example

1    @Transactional
2    public void foo() {
3        ...
4    }
5
6    public void bar() {
7        this.foo();
8    } 

when calling bar(), foo() will not be executed in a transaction, because AOP only works with calls from outside the class AFAIK. The same applies probably for other annotations like @Cacheable.

I would expect from my IDE to be warned or at least informed about this situation. So in the line 7 I would expect a marker.

Current Behavior

No hints at all. You need to know what is going on.

Context

The situation is simply error-prone for inexperienced devs. A simple info or warning marker could help resolving the risk.

@MahatmaFatalError MahatmaFatalError changed the title Warning when annotated methods are called from within its own class Warning when annotated methods are self-invocated from within its own class Feb 21, 2024
@martinlippert martinlippert added this to the Backlog milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants