Skip to content

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

Closed
@martinlippert

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) {
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions