ReflectiveMethodExecutor skips interface search (plus related polishing)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -86,17 +86,11 @@ public class GenericApplicationListenerAdapter implements GenericApplicationList
|
||||
return (this.delegate instanceof Ordered ? ((Ordered) this.delegate).getOrder() : Ordered.LOWEST_PRECEDENCE);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static ResolvableType resolveDeclaredEventType(Class<?> listenerType) {
|
||||
ResolvableType resolvableType = ResolvableType.forClass(listenerType).as(ApplicationListener.class);
|
||||
return (resolvableType.hasGenerics() ? resolvableType.getGeneric() : null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static ResolvableType resolveDeclaredEventType(ApplicationListener<ApplicationEvent> listener) {
|
||||
ResolvableType declaredEventType = resolveDeclaredEventType(listener.getClass());
|
||||
if (declaredEventType == null || declaredEventType.isAssignableFrom(
|
||||
ResolvableType.forClass(ApplicationEvent.class))) {
|
||||
if (declaredEventType == null || declaredEventType.isAssignableFrom(ApplicationEvent.class)) {
|
||||
Class<?> targetClass = AopUtils.getTargetClass(listener);
|
||||
if (targetClass != listener.getClass()) {
|
||||
declaredEventType = resolveDeclaredEventType(targetClass);
|
||||
@@ -105,4 +99,10 @@ public class GenericApplicationListenerAdapter implements GenericApplicationList
|
||||
return declaredEventType;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static ResolvableType resolveDeclaredEventType(Class<?> listenerType) {
|
||||
ResolvableType resolvableType = ResolvableType.forClass(listenerType).as(ApplicationListener.class);
|
||||
return (resolvableType.hasGenerics() ? resolvableType.getGeneric() : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user