Skip to content

Commit 9c44f92

Browse files
committed
fixed cron example (SPR-6772)
1 parent 6070a49 commit 9c44f92

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,20 +28,19 @@
2828
import org.springframework.util.StringUtils;
2929

3030
/**
31-
* Date sequence generator for a <a
32-
* href="http://www.manpagez.com/man/5/crontab/">Crontab pattern</a> allowing
33-
* client to specify a pattern that the sequence matches. The pattern is a list
34-
* of 6 single space separated fields representing (second, minute, hour, day,
35-
* month, weekday). Month and weekday names can be given as the first three
36-
* letters of the English names.<br/>
37-
* <br/>
31+
* Date sequence generator for a <a href="http://www.manpagez.com/man/5/crontab/">Crontab pattern</a>,
32+
* allowing clients to specify a pattern that the sequence matches.
3833
*
39-
* Example patterns
34+
* <p>The pattern is a list of six single space-separated fields: representing
35+
* second, minute, hour, day, month, weekday. Month and weekday names can be
36+
* given as the first three letters of the English names.
37+
*
38+
* <p>Example patterns:
4039
* <ul>
4140
* <li>"0 0 * * * *" = the top of every hour of every day.</li>
4241
* <li>"*&#47;10 * * * * *" = every ten seconds.</li>
4342
* <li>"0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.</li>
44-
* <li>"0 0 8-10/30 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.</li>
43+
* <li>"0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.</li>
4544
* <li>"0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays</li>
4645
* <li>"0 0 0 25 12 ?" = every Christmas Day at midnight</li>
4746
* </ul>
@@ -69,6 +68,7 @@ class CronSequenceGenerator {
6968

7069
private final TimeZone timeZone;
7170

71+
7272
/**
7373
* Construct a {@link CronSequenceGenerator} from the pattern provided.
7474
* @param expression a space-separated list of time fields
@@ -81,6 +81,7 @@ public CronSequenceGenerator(String expression, TimeZone timeZone) {
8181
parse(expression);
8282
}
8383

84+
8485
/**
8586
* Get the next {@link Date} in the sequence matching the Cron pattern and
8687
* after the value provided. The return value will have a whole number of
@@ -127,7 +128,7 @@ private void doNext(Calendar calendar) {
127128
List<Integer> resets = new ArrayList<Integer>();
128129

129130
int second = calendar.get(Calendar.SECOND);
130-
List<Integer> emptyList = Collections.<Integer> emptyList();
131+
List<Integer> emptyList = Collections.emptyList();
131132
int updateSecond = findNext(this.seconds, second, calendar, Calendar.SECOND, Calendar.MINUTE, emptyList);
132133
if (second == updateSecond) {
133134
resets.add(Calendar.SECOND);

0 commit comments

Comments
 (0)