mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
174d0e4576
Prior to this commit, `CronExpression` would support Quartz-style expressions with "Nth occurence of a dayOfWeek" semantics by using the `TemporalAdjusters.dayOfWeekInMonth` JDK support. This method will return the Nth occurence starting with the month of the given temporal, but in some cases will overflow to the next or previous month. This behavior is not expected for our cron expression support. This commit ensures that when an overflow happens (meaning, the resulting date is not in the same month as the input temporal), we should instead have another attempt at finding a valid month for this expression. Fixes gh-34360