Skip to content

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

Open

Description

@MahatmaFatalError

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.

Activity

  1. 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[/+] on Feb 21, 2024
  2. added
    for: eclipse
    for: vscode
    and removed on Feb 26, 2024
  3. added this to the Backlog milestone on Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: eclipsefor: vscodestatus: needs-discussionstatus: needs-investigationtheme: validationtype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions