spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Retrofit events for generics matching of ApplicationEvent subtypes with generic payload parameter

Open mp911de opened this issue 2 years ago • 1 comments

See https://github.com/spring-projects/spring-framework/issues/17661

mp911de avatar Jun 13 '23 14:06 mp911de

A side effect here is that listeners accepting Object (e.g. ApplicationListener<AfterSaveEvent<Object>>) no longer match any subtype because of the refined type matching. Instead, these listeners need to be defined as ApplicationListener<AfterSaveEvent<? extends Object>> which is actually the correct version according to generics.

mp911de avatar Jun 13 '23 14:06 mp911de