ScheduledAnnotationBeanPostProcessor accepts non-void methods as well

Issue: SPR-14175
This commit is contained in:
Juergen Hoeller
2016-04-14 21:59:02 +02:00
parent 999112216d
commit b28d96af7d
2 changed files with 56 additions and 39 deletions

View File

@@ -287,8 +287,6 @@ public class ScheduledAnnotationBeanPostProcessor implements BeanPostProcessor,
protected void processScheduled(Scheduled scheduled, Method method, Object bean) {
try {
Assert.isTrue(void.class == method.getReturnType(),
"Only void-returning methods may be annotated with @Scheduled");
Assert.isTrue(method.getParameterTypes().length == 0,
"Only no-arg methods may be annotated with @Scheduled");