Skip to content

[events] take type hierarchy of events into account when finding references across event listeners and publishers #1461

Closed

Description

@martinlippert

The first implementation for indexing event listeners and publishers + the corresponding navigation support (go to references) only takes the type of the event into account that is used in the publish method invocation or the listen method declaration. This does not take into account that a publisher might publish events of a subtype, compared to the event type used in the listener.

The event subtype:

public class SpecializedCustomEvent extends CustomEvent {
}

The publishEvent invocation using the subtype:

public void foo() {
	this.publisher.publishEvent(new SpecializedCustomEvent());
}

The listener still using the supetype:

@EventListener
public void handleEvent(CustomEvent event) {
}

Activity

  1. added
    for: eclipse
    for: vscode
    on Jan 31, 2025
  2. added this to the 4.29.0.RELEASE milestone on Jan 31, 2025
  3. added 3 commits that reference this issue on Feb 3, 2025
  4. added 9 commits that reference this issue on Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: spring index & symbolstype: enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions