-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Change in behaviour for cron expression with day of the week range starting with SUN #26598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Comments
This was referenced Mar 16, 2021
This was referenced Mar 17, 2021
Closed
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
This commit makes sure that SUN can be used at the beginning of a range, like SUN-FRI. Closes spring-projectsgh-26598
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Affects: Spring Framework 5.3
Before Spring 5.3 the parse for cron expressions had a different behaviour for the day of the week.
Example of an expression that has been working for years:
"32 22/5 * ? * SUN-FRI"
Example of its use in Spring 5.3:
CronExpression.parse("32 22/5 * ? * SUN-FRI");
Before the six space-separated string SUN-FRI was interpreted as 0-5.
Now in Spring 5.3 it is interpreted as 7-5 and that throws un exception:
A complete and very simple example of use:
It seems the class
org.springframework.scheduling.support.CronField
always consider Monday as position 0 (zero) in its array DAYS. But the documentation https://spring.io/blog/2020/11/10/new-in-spring-5-3-improved-cron-expressions says Sunday is zero (or seven).The text was updated successfully, but these errors were encountered: