From 9c44f9252d9fe3fe99265f5e0db788e293550d42 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 31 Jan 2010 14:17:44 +0000 Subject: [PATCH] fixed cron example (SPR-6772) --- .../support/CronSequenceGenerator.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java b/org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java index d6f8791578e..83119b7f425 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,20 +28,19 @@ import java.util.TimeZone; import org.springframework.util.StringUtils; /** - * Date sequence generator for a Crontab pattern allowing - * client to specify a pattern that the sequence matches. The pattern is a list - * of 6 single space separated fields representing (second, minute, hour, day, - * month, weekday). Month and weekday names can be given as the first three - * letters of the English names.
- *
+ * Date sequence generator for a Crontab pattern, + * allowing clients to specify a pattern that the sequence matches. * - * Example patterns + *

The pattern is a list of six single space-separated fields: representing + * second, minute, hour, day, month, weekday. Month and weekday names can be + * given as the first three letters of the English names. + * + *

Example patterns: *

@@ -69,6 +68,7 @@ class CronSequenceGenerator { private final TimeZone timeZone; + /** * Construct a {@link CronSequenceGenerator} from the pattern provided. * @param expression a space-separated list of time fields @@ -81,6 +81,7 @@ class CronSequenceGenerator { parse(expression); } + /** * Get the next {@link Date} in the sequence matching the Cron pattern and * after the value provided. The return value will have a whole number of @@ -127,7 +128,7 @@ class CronSequenceGenerator { List resets = new ArrayList(); int second = calendar.get(Calendar.SECOND); - List emptyList = Collections. emptyList(); + List emptyList = Collections.emptyList(); int updateSecond = findNext(this.seconds, second, calendar, Calendar.SECOND, Calendar.MINUTE, emptyList); if (second == updateSecond) { resets.add(Calendar.SECOND);