Support ResolvableTypeProvider on simple event pojo
Previously, the generic type of a simple pojo event implementing ResolvableTypeProvider wasn't detected properly. This commit fixes the logic when the generic type is not provided to reuse what PayloadApplicationEvent is already doing anyway. Issue: SPR-14029
This commit is contained in:
@@ -369,7 +369,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
else {
|
||||
applicationEvent = new PayloadApplicationEvent<Object>(this, event);
|
||||
if (eventType == null) {
|
||||
eventType = ResolvableType.forClassWithGenerics(PayloadApplicationEvent.class, event.getClass());
|
||||
eventType = ((PayloadApplicationEvent)applicationEvent).getResolvableType();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user