Skip to content

CronExpression::parse has invalid Javadoc #29884

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

Closed
andrei-zagrebin opened this issue Jan 25, 2023 · 3 comments
Closed

CronExpression::parse has invalid Javadoc #29884

andrei-zagrebin opened this issue Jan 25, 2023 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@andrei-zagrebin
Copy link

Affects: 5.3.24


Docs for spring-context org.springframework.scheduling.support.CronExpression#parse says:

In the "day of week" field, L stands for "the last day of the week". If prefixed by a number or three-letter name (i.e. dL or DDDL), it means "the last day of week d (or DDD) in the month".

Looks like it can be used without prefix, but it doesn't and the code throws en exception when there is not prefix before 'L' character.
So, the documentation doesn't match the code, and it seems to me that the documentation should be fixed.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 25, 2023
@poutsma poutsma self-assigned this Jan 26, 2023
@poutsma poutsma added the type: documentation A documentation task label Jan 26, 2023
@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Jan 27, 2023
@poutsma poutsma added this to the 6.0.5 milestone Jan 30, 2023
@poutsma poutsma changed the title CronExpression parse invalid documentation CronExpression::parse has invalid Javadoc Jan 30, 2023
@poutsma
Copy link
Contributor

poutsma commented Jan 30, 2023

Thanks for spotting this. Using a single L to indicate "last day of week" was allowed in an earlier version of CronExpression, but we decided to drop this feature thinking it would cause confusion when a cron expression would have a different meaning if deployed in different regions. We just forgot to drop the documentation.

@poutsma poutsma removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 30, 2023
@tdewolf
Copy link

tdewolf commented Feb 1, 2023

@poutsma so only dL or DDDL is supported or did L completely drop for last day of week?

@poutsma
Copy link
Contributor

poutsma commented Feb 2, 2023

IIRC, the single L was only supported in milestones, and dropped before 5.3.0. So it never was supported in any GA release, for reasons explained above.

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: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

5 participants