Skip to content
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

This method "CronExpression.isValidExpression()" will not work as expected. #1283

Open
ssyyzs opened this issue Dec 9, 2024 · 1 comment

Comments

@ssyyzs
Copy link

ssyyzs commented Dec 9, 2024

  • If "L" is used alone on the seconds, minutes, hours, or months of an cron expression,
    but otherwise formatted correctly. This method CronExpression.isValidExpression will return true, but the actual expression is wrong and should return false. For example:

CronExpression.isValidExpression("L 30 * * * ?"); // will return true

  • However, when we calculate the next trigger time through TriggerUtils.computeFireTimes() with this expression, an NoSuchElementException will be thrown. For Example :

TriggerUtils.computeFireTimes(new CronExpression("L 30 * * * ?"), null, 5); // throw runtime exception

  • Is it better to return a ParseException when constructing a CronExpression in this case?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ssyyzs and others