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

Exception during parsing more than one hours scope #35

Open
bartekkocik opened this issue Jun 14, 2016 · 1 comment
Open

Exception during parsing more than one hours scope #35

bartekkocik opened this issue Jun 14, 2016 · 1 comment

Comments

@bartekkocik
Copy link

bartekkocik commented Jun 14, 2016

Exception during parsing "0 0/30 0-6,10-23 * * ? *"

java.lang.NumberFormatException: For input string: "6,10" at java.lang.NumberFormatException.forInputString(Unknown Source) ~[na:1.8.0_77] at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_77] at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_77] at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:33) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:23) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.builder.HoursDescriptionBuilder.getSingleItemDescription(HoursDescriptionBuilder.java:16) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.builder.AbstractDescriptionBuilder.getSegmentDescription(AbstractDescriptionBuilder.java:36) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.CronExpressionDescriptor.getHoursDescription(CronExpressionDescriptor.java:174) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.CronExpressionDescriptor.getTimeOfDayDescription(CronExpressionDescriptor.java:211) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.CronExpressionDescriptor.getFullDescription(CronExpressionDescriptor.java:232) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:62) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:39) ~[cron-parser-2.6.jar!/:na] at net.redhogs.cronparser.format.CronExpressionFormatter.print(CronExpressionFormatter.java:45) ~[cron-parser-spring-2.8.jar!/:na]

It should work in that way
http://cronexpressiondescriptor.azurewebsites.net/?Language=en-US&DayOfWeekStartIndexOne=false&Use24HourFormat=false&VerboseDescription=false&Expression=0+0%2F30+0-6%2C10-23+*+*+%3F+*

@bartekkocik bartekkocik changed the title Exception during paring more than one hours scope Exception during parsing more than one hours scope Jun 14, 2016
@Sebastian-Habenicht
Copy link

It seems as if this error does not occur anymore. Tested with cron-parser-core 3.5 and I get "Every 30 minutes, at between 12:00 AM and 6:00 AM and between 10:00 AM and 11:00 PM"

However, the error still occurs when the minute value does not have a special character as in the example above. Parsing "0 0 0-6,10-23 * * ? *" still causes the exception.

java.lang.NumberFormatException: For input string: "0-6" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:36) at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:26) at net.redhogs.cronparser.CronExpressionDescriptor.getTimeOfDayDescription(CronExpressionDescriptor.java:206)

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