From b331ad5b2a7175df5cc8cba013395daccf68f98f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 27 Apr 2016 15:45:30 +0200 Subject: [PATCH] Explicit note on scheduled methods with a return value Issue: SPR-14195 --- .../springframework/scheduling/annotation/Scheduled.java | 9 +++++---- .../scheduling/config/spring-task-4.3.xsd | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java index 506dab5176..045dcd8a95 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java @@ -24,12 +24,13 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Annotation that marks a method to be scheduled. Exactly one of the - * {@link #cron()}, {@link #fixedDelay()}, or {@link #fixedRate()} + * An annotation that marks a method to be scheduled. Exactly one of + * the {@link #cron()}, {@link #fixedDelay()}, or {@link #fixedRate()} * attributes must be specified. * - *

The annotated method must expect no arguments and have a - * {@code void} return type. + *

The annotated method must expect no arguments. It will typically have + * a {@code void} return type; if not, the returned value will be ignored + * when called through the scheduler. * *

Processing of {@code @Scheduled} annotations is performed by * registering a {@link ScheduledAnnotationBeanPostProcessor}. This can be diff --git a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-4.3.xsd b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-4.3.xsd index 95bacf49b5..08358de9ad 100644 --- a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-4.3.xsd +++ b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-4.3.xsd @@ -293,7 +293,9 @@