This commit introduces a more defensive propagation of an event and the optionally associated eventType when calling publishEvent, especially when a parent context is present.

Notably, it avoids a situation where the parent publishEvent call would generate a new PayloadApplicationEvent with the wrong eventType (PayloadApplicationEvent<PayloadApplicationEvent<T>>).

This commit also adds test coverage (which includes cases where an event is fired before the multicaster is set) and a defensive check against inconsistent publishing of a PayloadApplicationEvent (even though that is something that is expected to be done mostly internally by the framework).

See gh-30360 Closes gh-30420

Comment From: simonbasle

superseded by https://github.com/spring-projects/spring-framework/commit/e228f4ba6479694975c93e2f2a908ed91481bc65