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

Cannot map day of week (5#1) #605

Open
alexey-anufriev opened this issue Jul 21, 2023 · 2 comments · May be fixed by #625
Open

Cannot map day of week (5#1) #605

alexey-anufriev opened this issue Jul 21, 2023 · 2 comments · May be fixed by #625

Comments

@alexey-anufriev
Copy link

It is not possible to perform the following mapping:

CronDefinition cronDefinition = CronDefinitionBuilder.instanceDefinitionFor(CronType.SPRING);
CronParser cronParser = new CronParser(cronDefinition);
Cron cron = cronParser.parse("0 0 0 ? * 5#1");
CronMapper mapper = CronMapper.fromSpringToQuartz();
Cron quartzCron = mapper.map(cron);

Execution leads to the following exception:

java.lang.IllegalArgumentException: value missing for a#b cron expression

	at com.cronutils.utils.Preconditions.checkArgument(Preconditions.java:110)
	at com.cronutils.model.field.expression.On.<init>(On.java:43)
	at com.cronutils.mapper.CronMapper$1.visit(CronMapper.java:294)
	at com.cronutils.model.field.expression.On.accept(On.java:70)
	at com.cronutils.mapper.CronMapper.lambda$dayOfWeekMapping$5(CronMapper.java:288)
	at com.cronutils.mapper.CronMapper.map(CronMapper.java:88)
@jmrozanec
Copy link
Owner

@alexey-anufriev may we ask you for a PR with the corresponding test? Thanks!

alexey-anufriev added a commit to alexey-anufriev/cron-utils that referenced this issue Jul 21, 2023
@alexey-anufriev
Copy link
Author

Sure, #606

austek added a commit to austek/cron-utils that referenced this issue May 9, 2024
austek added a commit to austek/cron-utils that referenced this issue May 9, 2024
@austek austek linked a pull request May 9, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants