mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-08 16:19:48 +00:00
Merge branch '7.0.x'
This commit is contained in:
+3
-3
@@ -106,8 +106,8 @@ public abstract class AbstractApplicationEventMulticaster
|
||||
synchronized (this.defaultRetriever) {
|
||||
// Explicitly remove target for a proxy, if registered already,
|
||||
// in order to avoid double invocations of the same listener.
|
||||
Object singletonTarget = AopProxyUtils.getSingletonTarget(listener);
|
||||
if (singletonTarget instanceof ApplicationListener) {
|
||||
Object singletonTarget = AopProxyUtils.ultimateSingletonTarget(listener);
|
||||
if (singletonTarget != listener && singletonTarget instanceof ApplicationListener) {
|
||||
this.defaultRetriever.applicationListeners.remove(singletonTarget);
|
||||
}
|
||||
this.defaultRetriever.applicationListeners.add(listener);
|
||||
@@ -270,7 +270,7 @@ public abstract class AbstractApplicationEventMulticaster
|
||||
// and replace them by their proxy counterparts, because if both a proxy and its target end up
|
||||
// in 'allListeners', listeners will fire twice.
|
||||
ApplicationListener<?> unwrappedListener =
|
||||
(ApplicationListener<?>) AopProxyUtils.getSingletonTarget(listener);
|
||||
(ApplicationListener<?>) AopProxyUtils.ultimateSingletonTarget(listener);
|
||||
if (listener != unwrappedListener) {
|
||||
if (filteredListeners != null && filteredListeners.contains(unwrappedListener)) {
|
||||
filteredListeners.remove(unwrappedListener);
|
||||
|
||||
+1
-4
@@ -326,10 +326,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
* @param bean the target bean instance
|
||||
*/
|
||||
protected void processScheduled(Scheduled scheduled, Method method, Object bean) {
|
||||
Object key = AopProxyUtils.getSingletonTarget(bean);
|
||||
if (key == null) {
|
||||
key = bean;
|
||||
}
|
||||
Object key = AopProxyUtils.ultimateSingletonTarget(bean);
|
||||
|
||||
// Is the method a Kotlin suspending function? Throws if true and the reactor bridge isn't on the classpath.
|
||||
// Does the method return a reactive type? Throws if true and it isn't a deferred Publisher type.
|
||||
|
||||
+1
-5
@@ -108,12 +108,8 @@ public class BeanValidationPostProcessor implements BeanPostProcessor, Initializ
|
||||
*/
|
||||
protected void doValidate(Object bean) {
|
||||
Assert.state(this.validator != null, "No Validator set");
|
||||
Object objectToValidate = AopProxyUtils.getSingletonTarget(bean);
|
||||
if (objectToValidate == null) {
|
||||
objectToValidate = bean;
|
||||
}
|
||||
Object objectToValidate = AopProxyUtils.ultimateSingletonTarget(bean);
|
||||
Set<ConstraintViolation<Object>> result = this.validator.validate(objectToValidate);
|
||||
|
||||
if (!result.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Bean state is invalid: ");
|
||||
for (Iterator<ConstraintViolation<Object>> it = result.iterator(); it.hasNext();) {
|
||||
|
||||
Reference in New Issue
Block a user