Closed chenkaifeng123 closed 2 years ago
@chenkaifeng123, thank you for reporting this. May we ask you for a test case to reproduce the issue? This is not necessarily a bug; it may signal that your cron expression does not conform to the cron definition. If no test case is provided, we may close this issue due to a lack of reproducibility. Thank you! 😄
@chenkaifeng123, thank you for reporting this. May we ask you for a test case to reproduce the issue? This is not necessarily a bug; it may signal that your cron expression does not conform to the cron definition. If no test case is provided, we may close this issue due to a lack of reproducibility. Thank you! 😄
sorry , I found this is because different CronType issue.
For this definition CronType.QUARTZ, it works and for CronType.SPRING it not work CronDefinition cronDefinition = CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ);
@chenkaifeng123, please provide a PR with the corresponding test case. Thanks! 😄
se provide a PR with the corresponding test case. Than
Ok, I will try to give this test case a little later.
Closing until a PR is provided.
The issue is when I configure cron expression like "0 0 8-1/1 ?" which means from moning 8:00 am to 1 am
CronParser parser = new CronParser(cronDefinition); Cron cron = parser.parse(cronStr); will throw exception
Caused by: java.lang.IllegalArgumentException: Invalid range! [8,1] at com.cronutils.model.field.expression.visitor.ValidationFieldExpressionVisitor.visit(ValidationFieldExpressionVisitor.java:75) at com.cronutils.model.field.expression.visitor.ValidationFieldExpressionVisitor.visit(ValidationFieldExpressionVisitor.java:25) at com.cronutils.model.field.expression.Between.accept(Between.java:36) at com.cronutils.model.field.expression.visitor.ValidationFieldExpressionVisitor.visit(ValidationFieldExpressionVisitor.java:86) at com.cronutils.model.field.expression.visitor.ValidationFieldExpressionVisitor.visit(ValidationFieldExpressionVisitor.java:25) at com.cronutils.model.field.expression.Every.accept(Every.java:50) at com.cronutils.model.SingleCron.validate(SingleCron.java:79) at com.cronutils.parser.CronParser.parse(CronParser.java:129) ... 29 more