-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Change in behaviour for cron expression with day of the week range starting with SUN #26598
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Feb 23, 2021
sbrannen
added
the
in: core
Issues in core modules (aop, beans, core, context, expression)
label
Feb 24, 2021
sbrannen
changed the title
Different behaviour for string with six space-separated string for day of the week
Change in behaviour for cron expression with day of the week range starting with SUN
Feb 24, 2021
poutsma
added
type: regression
A bug that is also a regression
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Feb 25, 2021
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: