Post-processors consistently ignore ScopedObject/AopInfrastructureBean

Issue: SPR-17166
This commit is contained in:
Juergen Hoeller
2018-08-12 14:36:20 +02:00
parent 6ed03c24ac
commit d8aecd8c87
3 changed files with 51 additions and 38 deletions

View File

@@ -330,7 +330,7 @@ public class ScheduledAnnotationBeanPostProcessor
if (annotatedMethods.isEmpty()) {
this.nonAnnotatedClasses.add(targetClass);
if (logger.isTraceEnabled()) {
logger.trace("No @Scheduled annotations found on bean class: " + bean.getClass());
logger.trace("No @Scheduled annotations found on bean class: " + targetClass);
}
}
else {
@@ -354,8 +354,7 @@ public class ScheduledAnnotationBeanPostProcessor
*/
protected void processScheduled(Scheduled scheduled, Method method, Object bean) {
try {
Assert.isTrue(method.getParameterCount() == 0,
"Only no-arg methods may be annotated with @Scheduled");
Assert.isTrue(method.getParameterCount() == 0, "Only no-arg methods may be annotated with @Scheduled");
Method invocableMethod = AopUtils.selectInvocableMethod(method, bean.getClass());
Runnable runnable = new ScheduledMethodRunnable(bean, invocableMethod);