diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java index 8f6a2a82f96..608e4c964fb 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java @@ -64,12 +64,12 @@ import org.springframework.util.StringValueResolver; * to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation. * *
This post-processor is automatically registered by Spring's
- * {@code Auto-detects any {@link SchedulingConfigurer} instances in the container,
- * allowing for customization of the scheduler to be used or for fine-grained control
- * over task registration (e.g. registration of {@link Trigger} tasks.
+ * Autodetects any {@link SchedulingConfigurer} instances in the container,
+ * allowing for customization of the scheduler to be used or for fine-grained
+ * control over task registration (e.g. registration of {@link Trigger} tasks.
* See the @{@link EnableScheduling} javadocs for complete usage details.
*
* @author Mark Fisher
@@ -216,9 +216,9 @@ public class ScheduledAnnotationBeanPostProcessor implements BeanPostProcessor,
@Override
public Object postProcessAfterInitialization(final Object bean, String beanName) {
- if (!this.nonAnnotatedClasses.contains(bean.getClass())) {
+ Class> targetClass = AopUtils.getTargetClass(bean);
+ if (!this.nonAnnotatedClasses.contains(targetClass)) {
final Set