|
|
|
@ -363,9 +363,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
|
|
|
|
// the second immediately following it.
|
|
|
|
|
while (difference == 1000) {
|
|
|
|
|
newDate = getTimeAfter(lastDate);
|
|
|
|
|
if(newDate == null)
|
|
|
|
|
if(newDate == null) {
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
difference = newDate.getTime() - lastDate.getTime();
|
|
|
|
|
|
|
|
|
|
if (difference == 1000) {
|
|
|
|
@ -668,8 +668,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
|
|
|
|
if(c == '-') {
|
|
|
|
|
ValueSet vs = getValue(0, s, i+1);
|
|
|
|
|
lastdayOffset = vs.value;
|
|
|
|
|
if(lastdayOffset > 30)
|
|
|
|
|
throw new ParseException("Offset from last day must be <= 30", i+1);
|
|
|
|
|
if(lastdayOffset > 30) {
|
|
|
|
|
throw new ParseException("Offset from last day must be <= 30", i + 1);
|
|
|
|
|
}
|
|
|
|
|
i = vs.pos;
|
|
|
|
|
}
|
|
|
|
|
if(s.length() > i) {
|
|
|
|
@ -732,8 +733,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
|
|
|
|
|
|
|
|
|
if (c == 'L') {
|
|
|
|
|
if (type == DAY_OF_WEEK) {
|
|
|
|
|
if(val < 1 || val > 7)
|
|
|
|
|
if(val < 1 || val > 7) {
|
|
|
|
|
throw new ParseException("Day-of-Week values must be between 1 and 7", -1);
|
|
|
|
|
}
|
|
|
|
|
lastdayOfWeek = true;
|
|
|
|
|
} else {
|
|
|
|
|
throw new ParseException("'L' option is not valid here. (pos=" + i + ")", i);
|
|
|
|
@ -750,8 +752,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
|
|
|
|
} else {
|
|
|
|
|
throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i);
|
|
|
|
|
}
|
|
|
|
|
if(val > 31)
|
|
|
|
|
throw new ParseException("The 'W' option does not make sense with values larger than 31 (max number of days in a month)", i);
|
|
|
|
|
if(val > 31) {
|
|
|
|
|
throw new ParseException("The 'W' option does not make sense with values larger than 31 (max number of days in a month)", i);
|
|
|
|
|
}
|
|
|
|
|
TreeSet<Integer> set = getSet(type);
|
|
|
|
|
set.add(val);
|
|
|
|
|
i++;
|
|
|
|
|