Closed
Description
ApplicationListenerMethodAdapter
wrongly indicates it would support a generic event type exposing unresolved generics, even if there's no type relationship between the events at all. See the following, failing test case:
class ApplicationListenerMethodAdapterTests {
@Test
void testName() throws Exception {
var method = ApplicationListenerMethodAdapterTests.class.getDeclaredMethod("listener", SomeOtherEvent.class);
var adapter = new ApplicationListenerMethodAdapter(null, ApplicationListenerMethodAdapterTests.class, method);
assertThat(adapter.supportsEventType(ResolvableType.forClass(SomeGenericEvent.class))).isFalse();
}
@EventListener
void listener(SomeOtherEvent event) {}
static class SomeGenericEvent<T> {}
static class SomeOtherEvent {}
}
Note how the adapter signals the event listener method would support SomeGenericEvent
when it clearly doesn't.