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:
Stephane Nicoll
2016-03-09 11:55:20 +01:00
parent ed341695a8
commit 8e24a4153c
3 changed files with 90 additions and 2 deletions

View File

@@ -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();
}
}