Bare L in the day-of-week field (as opposed to nL) has two separate defects. Scheduling was fixed for Quartz in #142 / 6.0.0, but the description was not, and the fix does not carry over to definitions that number days differently.
1. Description is wrong for every cron type
CronDescriptor d = CronDescriptor.instance(Locale.UK);
CronParser quartz = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
d.describe(quartz.parse("0 0 0 ? * L *"));
Actual: at 00:00 last Sunday of every month
Expected: something like at 00:00 every Saturday
Both halves are wrong — it is not restricted to the last week of the month, and the day is Saturday, not Sunday. The scheduling for QUARTZ is correct (every Saturday: 2025-06-07, 06-14, 06-21, 06-28, 07-05, matching org.quartz.CronExpression 2.5.0 exactly), so this is purely a describer bug and the two surfaces disagree with each other.
2. Wrong day scheduled for definitions with a 0-7 / Monday=1 range
CronParser spring53 = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.SPRING53));
ExecutionTime.forCron(spring53.parse("0 0 0 ? * L"));
|
next 5 executions |
QUARTZ |
2025-06-07, 06-14, 06-21, 06-28, 07-05 — all Saturday, correct |
SPRING53 |
2025-06-08, 06-15, 06-22, 06-29, 07-06 — all Sunday |
Bare L should mean the last day of the week regardless of how the definition numbers its days.
Cause
OnDayOfWeekValueGenerator holds Saturday as a literal in Quartz numbering:
private static final On ON_SATURDAY = new On(new IntegerFieldValue(7));
and generateNoneValues then normalizes that value using the current definition's scheme:
final int requiredDoW = ConstantsMapper.weekDayMapping(mondayDoWValue, ConstantsMapper.JAVA8, on.getTime().getValue());
For QUARTZ (mondayDoWValue = 2, 1=Sun..7=Sat) the literal 7 maps to Saturday, which is why #142 looks fixed. For SPRING53 (mondayDoWValue = 1, plus withIntMapping(7, 0)) the same literal maps to Sunday. The constant is in one numbering but is interpreted in another, so it only happens to be right for Quartz.
Version: both reproduced on master (bac6e86); #2 also affects released 9.2.1 via SPRING53.
Bare
Lin the day-of-week field (as opposed tonL) has two separate defects. Scheduling was fixed for Quartz in #142 / 6.0.0, but the description was not, and the fix does not carry over to definitions that number days differently.1. Description is wrong for every cron type
Actual:
at 00:00 last Sunday of every monthExpected: something like
at 00:00 every SaturdayBoth halves are wrong — it is not restricted to the last week of the month, and the day is Saturday, not Sunday. The scheduling for
QUARTZis correct (every Saturday: 2025-06-07, 06-14, 06-21, 06-28, 07-05, matchingorg.quartz.CronExpression2.5.0 exactly), so this is purely a describer bug and the two surfaces disagree with each other.2. Wrong day scheduled for definitions with a 0-7 / Monday=1 range
QUARTZSPRING53Bare
Lshould mean the last day of the week regardless of how the definition numbers its days.Cause
OnDayOfWeekValueGeneratorholds Saturday as a literal in Quartz numbering:and
generateNoneValuesthen normalizes that value using the current definition's scheme:For
QUARTZ(mondayDoWValue = 2, 1=Sun..7=Sat) the literal7maps to Saturday, which is why #142 looks fixed. ForSPRING53(mondayDoWValue = 1, pluswithIntMapping(7, 0)) the same literal maps to Sunday. The constant is in one numbering but is interpreted in another, so it only happens to be right for Quartz.Version: both reproduced on
master(bac6e86); #2 also affects released 9.2.1 viaSPRING53.