From 5652f02af0aa56eeba8f3dfb8e230597ed738bf6 Mon Sep 17 00:00:00 2001 From: Elizabeth Chatman Date: Tue, 19 May 2015 11:53:59 -0700 Subject: [PATCH] Fix number parsing of @Scheduled attributes See gh-801 --- .../annotation/ScheduledAnnotationBeanPostProcessor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 cfbf474e68..6131aba8ad 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 @@ -75,6 +75,7 @@ import org.springframework.util.StringValueResolver; * @author Mark Fisher * @author Juergen Hoeller * @author Chris Beams + * @author Elizabeth Chatman * @since 3.0 * @see Scheduled * @see EnableScheduling @@ -295,7 +296,7 @@ public class ScheduledAnnotationBeanPostProcessor implements BeanPostProcessor, initialDelayString = this.embeddedValueResolver.resolveStringValue(initialDelayString); } try { - initialDelay = Integer.parseInt(initialDelayString); + initialDelay = Long.parseLong(initialDelayString); } catch (NumberFormatException ex) { throw new IllegalArgumentException( @@ -343,7 +344,7 @@ public class ScheduledAnnotationBeanPostProcessor implements BeanPostProcessor, fixedDelayString = this.embeddedValueResolver.resolveStringValue(fixedDelayString); } try { - fixedDelay = Integer.parseInt(fixedDelayString); + fixedDelay = Long.parseLong(fixedDelayString); } catch (NumberFormatException ex) { throw new IllegalArgumentException( @@ -367,7 +368,7 @@ public class ScheduledAnnotationBeanPostProcessor implements BeanPostProcessor, fixedRateString = this.embeddedValueResolver.resolveStringValue(fixedRateString); } try { - fixedRate = Integer.parseInt(fixedRateString); + fixedRate = Long.parseLong(fixedRateString); } catch (NumberFormatException ex) { throw new IllegalArgumentException(