88import java .util .List ;
99import java .util .stream .Collectors ;
1010
11- import antlr .ANTLRException ;
12-
1311/**
1412 * mostly a copy of {@link CronTabList}
1513 *
@@ -24,11 +22,11 @@ public ParameterizedCronTabList(List<ParameterizedCronTab> cronTabs) {
2422 this .cronTabs = cronTabs ;
2523 }
2624
27- public static ParameterizedCronTabList create (String cronTabSpecification ) throws ANTLRException {
25+ public static ParameterizedCronTabList create (String cronTabSpecification ) {
2826 return create (cronTabSpecification , null );
2927 }
3028
31- public static ParameterizedCronTabList create (String cronTabSpecification , Hash hash ) throws ANTLRException {
29+ public static ParameterizedCronTabList create (String cronTabSpecification , Hash hash ) {
3230 List <ParameterizedCronTab > result = new ArrayList <>();
3331 int lineNumber = 0 ;
3432 String timezone = null ;
@@ -39,13 +37,13 @@ public static ParameterizedCronTabList create(String cronTabSpecification, Hash
3937 if (lineNumber == 1 && line .startsWith ("TZ=" )) {
4038 timezone = CronTabList .getValidTimezone (line .replace ("TZ=" , "" ));
4139 if (timezone == null ) {
42- throw new ANTLRException ("Invalid or unsupported timezone '" + line + "'" );
40+ throw new IllegalArgumentException ("Invalid or unsupported timezone '" + line + "'" );
4341 }
4442 } else {
4543 try {
4644 result .add (ParameterizedCronTab .create (line , lineNumber , hash , timezone ));
47- } catch (ANTLRException e ) {
48- throw new ANTLRException (String .format ("Invalid input: \" %s\" : %s" , line , e ), e );
45+ } catch (IllegalArgumentException e ) {
46+ throw new IllegalArgumentException (String .format ("Invalid input: \" %s\" : %s" , line , e ), e );
4947 }
5048 }
5149 }
0 commit comments