nus-yam/ex-repair huggingface dataset:
Program: 4147
Project: 4147
Buggy source:
@Test public void testCronDefinitionExecutionTimeGenerator(){
  CronDefinition cronDefinition=defineCron().withMinutes().and().withHours().and().withDayOfWeek().optional().and().instance();
  CronParser parser=new CronParser(cronDefinition);
  Cron cron=parser.parse(CRON_EXPRESSION);
  ExecutionTime executionTime=ExecutionTime.forCron(cron);
  executionTime.isMatch(ZonedDateTime.now());
}

Fixed version (ground truth):
@Test public void testCronDefinitionExecutionTimeGenerator(){
  final CronDefinition cronDefinition=defineCron().withMinutes().and().withHours().and().withDayOfWeek().optional().and().instance();
  final CronParser parser=new CronParser(cronDefinition);
  final Cron cron=parser.parse(CRON_EXPRESSION);
  final ExecutionTime executionTime=ExecutionTime.forCron(cron);
  executionTime.isMatch(ZonedDateTime.now());
}
Program: 4148
Project: 4148
Buggy source:
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron2).nextExecution(time).get());
}

Fixed version (ground truth):
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results.
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  final CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  final CronParser parser=new CronParser(cronDefinition);
  final Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  final Optional<ZonedDateTime> nextExecution=ExecutionTime.forCron(myCron).nextExecution(time);
  if (nextExecution.isPresent()) {
    assertEquals(ZonedDateTime.parse("String_Node_Str"),nextExecution.get());
  }
 else {
    fail("String_Node_Str");
  }
  final Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  final Optional<ZonedDateTime> nextExecution2=ExecutionTime.forCron(myCron2).nextExecution(time);
  if (nextExecution2.isPresent()) {
    assertEquals(ZonedDateTime.parse("String_Node_Str"),nextExecution2.get());
  }
 else {
    fail("String_Node_Str");
  }
}
Program: 4149
Project: 4149
Buggy source:
public void testCase3(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).get();
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,00),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
public void testCase3(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}
Program: 4150
Project: 4150
Buggy source:
@Test public void testCase2(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).get();
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2012,12,29,12,00),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase2(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2012,12,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}
Program: 4151
Project: 4151
Buggy source:
@Test public void testCase4(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).get();
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2016,10,29,12,00),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase4(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2016,10,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}
Program: 4152
Project: 4152
Buggy source:
@Before public void setUp() throws Exception {
  currentDateTime=ZonedDateTime.of(LocalDateTime.of(2016,12,20,12,00),ZoneId.systemDefault());
  parser=new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  currentDateTime=ZonedDateTime.of(LocalDateTime.of(2016,12,20,12,0),ZoneId.systemDefault());
  parser=new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
}
Program: 4153
Project: 4153
Buggy source:
@Test public void testCase1(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).get();
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,00),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase1(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}
Program: 4154
Project: 4154
Buggy source:
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next2=ExecutionTime.forCron(myCron2).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron2).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next2);
}

Fixed version (ground truth):
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext2=ExecutionTime.forCron(myCron2).nextExecution(time);
  ZonedDateTime next2=onext2.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next2);
}
Program: 4155
Project: 4155
Buggy source:
private List<Instant> getInstants(ExecutionTime executionTime,ZonedDateTime startTime,ZonedDateTime endTime){
  List<Instant> instantList=new ArrayList<>();
  ZonedDateTime next=executionTime.nextExecution(startTime).isPresent() ? executionTime.nextExecution(startTime).get() : null;
  while (next != null && next.isBefore(endTime)) {
    instantList.add(next.toInstant());
    next=executionTime.nextExecution(next).isPresent() ? executionTime.nextExecution(next).get() : null;
  }
  return instantList;
}

Fixed version (ground truth):
private List<Instant> getInstants(ExecutionTime executionTime,ZonedDateTime startTime,ZonedDateTime endTime){
  List<Instant> instantList=new ArrayList<>();
  Optional<ZonedDateTime> onext=executionTime.nextExecution(startTime);
  ZonedDateTime next=onext.orElse(null);
  while (next != null && next.isBefore(endTime)) {
    instantList.add(next.toInstant());
    onext=executionTime.nextExecution(next);
    next=onext.orElse(null);
  }
  return instantList;
}
Program: 4156
Project: 4156
Buggy source:
public void testCase3(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
public void testCase3(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  Optional<ZonedDateTime> olast=et.lastExecution(currentDateTime);
  ZonedDateTime last=olast.orElse(null);
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,last);
}
Program: 4157
Project: 4157
Buggy source:
@Test public void testCase2(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2012,12,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase2(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  Optional<ZonedDateTime> olast=et.lastExecution(currentDateTime);
  ZonedDateTime last=olast.orElse(null);
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2012,12,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,last);
}
Program: 4158
Project: 4158
Buggy source:
@Test public void testCase4(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2016,10,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase4(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  Optional<ZonedDateTime> olast=et.lastExecution(currentDateTime);
  ZonedDateTime last=olast.orElse(null);
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2016,10,29,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,last);
}
Program: 4159
Project: 4159
Buggy source:
@Test public void testCase1(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  ZonedDateTime actual=et.lastExecution(currentDateTime).isPresent() ? et.lastExecution(currentDateTime).get() : null;
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testCase1(){
  ExecutionTime et=ExecutionTime.forCron(parser.parse("String_Node_Str"));
  Optional<ZonedDateTime> olast=et.lastExecution(currentDateTime);
  ZonedDateTime last=olast.orElse(null);
  ZonedDateTime expected=ZonedDateTime.of(LocalDateTime.of(2015,12,31,12,0),ZoneId.systemDefault());
  Assert.assertEquals(expected,last);
}
Program: 4160
Project: 4160
Buggy source:
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next2=ExecutionTime.forCron(myCron2).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron2).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next2);
}

Fixed version (ground truth):
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next2=ExecutionTime.forCron(myCron2).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron2).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next2);
}
Program: 4161
Project: 4161
Buggy source:
@Test public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}

Fixed version (ground truth):
@Test public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4162
Project: 4162
Buggy source:
@Test public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}

Fixed version (ground truth):
@Test public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4163
Project: 4163
Buggy source:
@Test public void testFirstMondayOfTheMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}

Fixed version (ground truth):
@Test public void testFirstMondayOfTheMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4164
Project: 4164
Buggy source:
@Test public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}

Fixed version (ground truth):
@Test public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4165
Project: 4165
Buggy source:
@Test public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}

Fixed version (ground truth):
@Test public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  Optional<ZonedDateTime> onext=ExecutionTime.forCron(myCron).nextExecution(time);
  ZonedDateTime next=onext.orElse(null);
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4167
Project: 4167
Buggy source:
@Override public String describe(){
  final TimeFields fields=new TimeFields(hours,minutes,seconds);
  for (  final Function<TimeFields,String> function : descriptions) {
    if (!"String_Node_Str".equals(function.apply(fields))) {
      return function.apply(fields);
    }
  }
  String secondsDesc="String_Node_Str";
  String minutesDesc="String_Node_Str";
  final String hoursDesc=addTimeExpressions(describe(hours),bundle.getString("String_Node_Str"),bundle.getString("String_Node_Str"));
  if (!(seconds instanceof On && isDefault((On)seconds))) {
    secondsDesc=addTimeExpressions(describe(seconds),bundle.getString("String_Node_Str"),bundle.getString("String_Node_Str"));
  }
  if (!(minutes instanceof On && isDefault((On)minutes))) {
    minutesDesc=addTimeExpressions(describe(minutes),bundle.getString("String_Node_Str"),bundle.getString("String_Node_Str"));
  }
  return String.format("String_Node_Str",secondsDesc,minutesDesc,hoursDesc);
}

Fixed version (ground truth):
@Override public String describe(){
  final TimeFields fields=new TimeFields(hours,minutes,seconds);
  for (  final Function<TimeFields,String> function : descriptions) {
    if (!"String_Node_Str".equals(function.apply(fields))) {
      return function.apply(fields);
    }
  }
  String secondsDesc="String_Node_Str";
  String minutesDesc="String_Node_Str";
  final String hoursDesc=addTimeExpressions(describe(hours),bundle.getString("String_Node_Str"),bundle.getString("String_Node_Str"));
  if (!(seconds instanceof On && isDefault((On)seconds))) {
    secondsDesc=addTimeExpressions(describe(seconds),bundle.getString(SECOND),bundle.getString("String_Node_Str"));
  }
  if (!(minutes instanceof On && isDefault((On)minutes))) {
    minutesDesc=addTimeExpressions(describe(minutes),bundle.getString(MINUTE),bundle.getString("String_Node_Str"));
  }
  return String.format("String_Node_Str",secondsDesc,minutesDesc,hoursDesc);
}
Program: 4168
Project: 4168
Buggy source:
private List<Instant> getInstants(ExecutionTime executionTime,ZonedDateTime startTime,ZonedDateTime endTime){
  List<Instant> instantList=new ArrayList<>();
  ZonedDateTime next=executionTime.nextExecution(startTime).get();
  while (next.isBefore(endTime)) {
    instantList.add(next.toInstant());
    next=executionTime.nextExecution(next).get();
  }
  return instantList;
}

Fixed version (ground truth):
private List<Instant> getInstants(ExecutionTime executionTime,ZonedDateTime startTime,ZonedDateTime endTime){
  List<Instant> instantList=new ArrayList<>();
  ZonedDateTime next=executionTime.nextExecution(startTime).isPresent() ? executionTime.nextExecution(startTime).get() : null;
  while (next != null && next.isBefore(endTime)) {
    instantList.add(next.toInstant());
    next=executionTime.nextExecution(next).isPresent() ? executionTime.nextExecution(next).get() : null;
  }
  return instantList;
}
Program: 4169
Project: 4169
Buggy source:
private static ZonedDateTime nextSchedule(String cronString,ZonedDateTime lastExecution){
  CronParser cronParser=new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX));
  Cron cron=cronParser.parse(cronString);
  ExecutionTime executionTime=ExecutionTime.forCron(cron);
  return executionTime.nextExecution(lastExecution).get();
}

Fixed version (ground truth):
private static ZonedDateTime nextSchedule(String cronString,ZonedDateTime lastExecution){
  CronParser cronParser=new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX));
  Cron cron=cronParser.parse(cronString);
  ExecutionTime executionTime=ExecutionTime.forCron(cron);
  return executionTime.nextExecution(lastExecution).isPresent() ? executionTime.nextExecution(lastExecution).get() : null;
}
Program: 4170
Project: 4170
Buggy source:
@Test public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
@Test public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4171
Project: 4171
Buggy source:
@Test public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
@Test public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4172
Project: 4172
Buggy source:
@Test public void testFirstMondayOfTheMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
@Test public void testFirstMondayOfTheMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4173
Project: 4173
Buggy source:
@Test public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
@Test public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4174
Project: 4174
Buggy source:
@Test public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
@Test public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
}
Program: 4175
Project: 4175
Buggy source:
public StringValidations(FieldConstraints constraints){
  this.lwPattern=buildLWPattern(constraints.getSpecialChars());
  this.stringToIntKeysPattern=buildStringToIntPattern(constraints.getStringMappingKeySet());
}

Fixed version (ground truth):
public StringValidations(final FieldConstraints constraints){
  lwPattern=buildLWPattern(constraints.getSpecialChars());
  stringToIntKeysPattern=buildStringToIntPattern(constraints.getStringMappingKeySet());
}
Program: 4176
Project: 4176
Buggy source:
@VisibleForTesting Pattern buildStringToIntPattern(Set<String> strings){
  return buildWordsPattern(strings);
}

Fixed version (ground truth):
@VisibleForTesting Pattern buildStringToIntPattern(final Set<String> strings){
  return buildWordsPattern(strings);
}
Program: 4177
Project: 4177
Buggy source:
@VisibleForTesting Pattern buildWordsPattern(Set<String> words){
  StringBuilder builder=new StringBuilder(ESCAPED_START);
  Iterator<String> iterator=words.iterator();
  if (!iterator.hasNext()) {
    builder.append(ESCAPED_END);
    return Pattern.compile(builder.toString());
  }
  String next=iterator.next();
  builder.append(next);
  while (iterator.hasNext()) {
    builder.append("String_Node_Str");
    builder.append(iterator.next());
  }
  builder.append(ESCAPED_END);
  return Pattern.compile(builder.toString());
}

Fixed version (ground truth):
@VisibleForTesting Pattern buildWordsPattern(final Set<String> words){
  final StringBuilder builder=new StringBuilder(ESCAPED_START);
  final Iterator<String> iterator=words.iterator();
  if (!iterator.hasNext()) {
    builder.append(ESCAPED_END);
    return Pattern.compile(builder.toString());
  }
  final String next=iterator.next();
  builder.append(next);
  while (iterator.hasNext()) {
    builder.append("String_Node_Str");
    builder.append(iterator.next());
  }
  builder.append(ESCAPED_END);
  return Pattern.compile(builder.toString());
}
Program: 4178
Project: 4178
Buggy source:
@VisibleForTesting public String removeValidChars(String exp){
  Matcher numsAndCharsMatcher=NUMS_AND_CHARS_PATTERN.matcher(exp.toUpperCase());
  Matcher stringToIntKeysMatcher=stringToIntKeysPattern.matcher(numsAndCharsMatcher.replaceAll("String_Node_Str"));
  Matcher specialWordsMatcher=lwPattern.matcher(stringToIntKeysMatcher.replaceAll("String_Node_Str"));
  return specialWordsMatcher.replaceAll("String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@VisibleForTesting public String removeValidChars(final String exp){
  final Matcher numsAndCharsMatcher=NUMS_AND_CHARS_PATTERN.matcher(exp.toUpperCase());
  final Matcher stringToIntKeysMatcher=stringToIntKeysPattern.matcher(numsAndCharsMatcher.replaceAll("String_Node_Str"));
  final Matcher specialWordsMatcher=lwPattern.matcher(stringToIntKeysMatcher.replaceAll("String_Node_Str"));
  return specialWordsMatcher.replaceAll("String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
}
Program: 4179
Project: 4179
Buggy source:
@VisibleForTesting Pattern buildLWPattern(Set<SpecialChar> specialChars){
  Set<String> scs=new HashSet<>();
  for (  SpecialChar sc : SPECIAL_CHARS) {
    if (specialChars.contains(sc)) {
      scs.add(sc.name());
    }
  }
  return buildWordsPattern(scs);
}

Fixed version (ground truth):
@VisibleForTesting Pattern buildLWPattern(final Set<SpecialChar> specialChars){
  final Set<String> scs=new HashSet<>();
  for (  final SpecialChar sc : SPECIAL_CHARS) {
    if (specialChars.contains(sc)) {
      scs.add(sc.name());
    }
  }
  return buildWordsPattern(scs);
}
Program: 4180
Project: 4180
Buggy source:
public static CronBuilder cron(CronDefinition definition){
  return new CronBuilder(definition);
}

Fixed version (ground truth):
public static CronBuilder cron(final CronDefinition definition){
  return new CronBuilder(definition);
}
Program: 4181
Project: 4181
Buggy source:
public CronBuilder withHour(FieldExpression expression){
  return addField(HOUR,expression);
}

Fixed version (ground truth):
public CronBuilder withHour(final FieldExpression expression){
  return addField(HOUR,expression);
}
Program: 4182
Project: 4182
Buggy source:
public CronBuilder withDoW(FieldExpression expression){
  return addField(DAY_OF_WEEK,expression);
}

Fixed version (ground truth):
public CronBuilder withDoW(final FieldExpression expression){
  return addField(DAY_OF_WEEK,expression);
}
Program: 4183
Project: 4183
Buggy source:
private CronBuilder(CronDefinition definition){
  this.definition=definition;
}

Fixed version (ground truth):
private CronBuilder(final CronDefinition definition){
  this.definition=definition;
}
Program: 4184
Project: 4184
Buggy source:
@VisibleForTesting CronBuilder addField(CronFieldName name,FieldExpression expression){
  checkState(definition != null,"String_Node_Str");
  FieldConstraints constraints=definition.getFieldDefinition(name).getConstraints();
  expression.accept(new ValidationFieldExpressionVisitor(constraints,definition.isStrictRanges()));
  fields.put(name,new CronField(name,expression,constraints));
  return this;
}

Fixed version (ground truth):
@VisibleForTesting CronBuilder addField(final CronFieldName name,final FieldExpression expression){
  checkState(definition != null,"String_Node_Str");
  final FieldConstraints constraints=definition.getFieldDefinition(name).getConstraints();
  expression.accept(new ValidationFieldExpressionVisitor(constraints,definition.isStrictRanges()));
  fields.put(name,new CronField(name,expression,constraints));
  return this;
}
Program: 4185
Project: 4185
Buggy source:
public CronBuilder withDoM(FieldExpression expression){
  return addField(DAY_OF_MONTH,expression);
}

Fixed version (ground truth):
public CronBuilder withDoM(final FieldExpression expression){
  return addField(DAY_OF_MONTH,expression);
}
Program: 4186
Project: 4186
Buggy source:
public CronBuilder withYear(FieldExpression expression){
  return addField(YEAR,expression);
}

Fixed version (ground truth):
public CronBuilder withYear(final FieldExpression expression){
  return addField(YEAR,expression);
}
Program: 4187
Project: 4187
Buggy source:
public CronBuilder withMinute(FieldExpression expression){
  return addField(MINUTE,expression);
}

Fixed version (ground truth):
public CronBuilder withMinute(final FieldExpression expression){
  return addField(MINUTE,expression);
}
Program: 4188
Project: 4188
Buggy source:
public CronBuilder withDoY(FieldExpression expression){
  return addField(DAY_OF_YEAR,expression);
}

Fixed version (ground truth):
public CronBuilder withDoY(final FieldExpression expression){
  return addField(DAY_OF_YEAR,expression);
}
Program: 4189
Project: 4189
Buggy source:
public CronBuilder withMonth(FieldExpression expression){
  return addField(MONTH,expression);
}

Fixed version (ground truth):
public CronBuilder withMonth(final FieldExpression expression){
  return addField(MONTH,expression);
}
Program: 4190
Project: 4190
Buggy source:
public CronBuilder withSecond(FieldExpression expression){
  return addField(SECOND,expression);
}

Fixed version (ground truth):
public CronBuilder withSecond(final FieldExpression expression){
  return addField(SECOND,expression);
}
Program: 4191
Project: 4191
Buggy source:
private static void cronValidation(String[] args) throws ParseException {
  Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str",HELP,false,"String_Node_Str");
  String header="String_Node_Str";
  String footer="String_Node_Str";
  CommandLineParser parser=new DefaultParser();
  CommandLine cmd=parser.parse(options,args);
  if (cmd.hasOption(HELP) || cmd.getOptions().length == 0) {
    showHelp(options,header,footer);
    return;
  }
  if (!cmd.hasOption("String_Node_Str")) {
    showHelp(options,header,footer);
    return;
  }
  if (cmd.hasOption('v')) {
    String format=cmd.getOptionValue("String_Node_Str");
    String expression=cmd.getOptionValue("String_Node_Str");
    CronType cronType=CronType.valueOf(format);
    CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(cronType);
    CronParser cronParser=new CronParser(cronDefinition);
    Cron quartzCron=cronParser.parse(expression);
    quartzCron.validate();
  }
}

Fixed version (ground truth):
private static void cronValidation(final String[] args) throws ParseException {
  final Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str",HELP,false,"String_Node_Str");
  final String header="String_Node_Str";
  final String footer="String_Node_Str";
  final CommandLineParser parser=new DefaultParser();
  final CommandLine cmd=parser.parse(options,args);
  if (cmd.hasOption(HELP) || cmd.getOptions().length == 0) {
    showHelp(options,header,footer);
    return;
  }
  if (!cmd.hasOption("String_Node_Str")) {
    showHelp(options,header,footer);
    return;
  }
  if (cmd.hasOption('v')) {
    final String format=cmd.getOptionValue("String_Node_Str");
    final String expression=cmd.getOptionValue("String_Node_Str");
    final CronType cronType=CronType.valueOf(format);
    final CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(cronType);
    final CronParser cronParser=new CronParser(cronDefinition);
    final Cron quartzCron=cronParser.parse(expression);
    quartzCron.validate();
  }
}
Program: 4192
Project: 4192
Buggy source:
private static void showHelp(Options options,String header,String footer){
  HelpFormatter formatter=new HelpFormatter();
  formatter.printHelp("String_Node_Str",header,options,footer,true);
}

Fixed version (ground truth):
private static void showHelp(final Options options,final String header,final String footer){
  final HelpFormatter formatter=new HelpFormatter();
  formatter.printHelp("String_Node_Str",header,options,footer,true);
}
Program: 4193
Project: 4193
Buggy source:
public static void main(String[] args) throws Exception {
  cronValidation(args);
}

Fixed version (ground truth):
public static void main(final String[] args) throws Exception {
  cronValidation(args);
}
Program: 4194
Project: 4194
Buggy source:
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron2).nextExecution(time).get());
}

Fixed version (ground truth):
/** 
 * Issue #223: for dayOfWeek value == 3 && division of day, nextExecution do not return correct results
 */
@Test public void testEveryWednesdayOfEveryDayNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next=ExecutionTime.forCron(myCron).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next);
  Cron myCron2=parser.parse("String_Node_Str");
  time=ZonedDateTime.parse("String_Node_Str");
  ZonedDateTime next2=ExecutionTime.forCron(myCron2).nextExecution(time).isPresent() ? ExecutionTime.forCron(myCron2).nextExecution(time).get() : null;
  assertEquals(ZonedDateTime.parse("String_Node_Str"),next2);
}
Program: 4197
Project: 4197
Buggy source:
/** 
 * Issue #43: getting bad description for expression
 * @throws Exception
 */
public void testEveryDayEveryFourHoursFromHour2() throws Exception {
  assertExpression("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Issue #43: getting bad description for expression
 * @throws Exception
 */
@Test public void testEveryDayEveryFourHoursFromHour2() throws Exception {
  assertExpression("String_Node_Str","String_Node_Str");
}
Program: 4198
Project: 4198
Buggy source:
public void testThatEveryMinuteIsPreserved(){
  CronDefinition quartzDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ);
  parser=new CronParser(quartzDefinition);
  Cron expression=parser.parse("String_Node_Str");
  assertEquals("String_Node_Str",expression.asString());
}

Fixed version (ground truth):
@Test public void testThatEveryMinuteIsPreserved(){
  CronDefinition quartzDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ);
  parser=new CronParser(quartzDefinition);
  Cron expression=parser.parse("String_Node_Str");
  assertEquals("String_Node_Str",expression.asString());
}
Program: 4199
Project: 4199
Buggy source:
@Test public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
public void testEveryWeekendForthWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}
Program: 4200
Project: 4200
Buggy source:
@Test public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
public void testEveryWeekdayFirstWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}
Program: 4201
Project: 4201
Buggy source:
/** 
 * Issue #228: dayOfWeek just isn't honored in the cron next execution evaluation and needs to be
 */
@Test public void testFirstMondayOfTheMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
/** 
 * Issue #228: dayOfWeek just isn't honored in the cron next execution evaluation and needs to be
 */
public void testFirstMondayOfTheMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}
Program: 4202
Project: 4202
Buggy source:
@Test public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
public void testEveryWeekdaySecondWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}
Program: 4203
Project: 4203
Buggy source:
@Test public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}

Fixed version (ground truth):
public void testEveryWeekendFirstWeekOfMonthNextExecution(){
  CronDefinition cronDefinition=CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX);
  CronParser parser=new CronParser(cronDefinition);
  Cron myCron=parser.parse("String_Node_Str");
  ZonedDateTime time=ZonedDateTime.parse("String_Node_Str");
  assertEquals(ZonedDateTime.parse("String_Node_Str"),ExecutionTime.forCron(myCron).nextExecution(time).get());
}
Program: 4204
Project: 4204
Buggy source:
/** 
 * Constructor
 * @param fieldDefinitions - list with field definitions. Must not be null or empty.Throws a NullPointerException if a null values is received Throws an IllegalArgumentException if an empty list is received
 */
public CronDefinition(List<FieldDefinition> fieldDefinitions,Set<CronConstraint> cronConstraints,boolean strictRanges){
  Preconditions.checkNotNull(fieldDefinitions,"String_Node_Str");
  Preconditions.checkNotNull(cronConstraints,"String_Node_Str");
  Preconditions.checkNotNullNorEmpty(fieldDefinitions,"String_Node_Str");
  Preconditions.checkArgument(!fieldDefinitions.get(0).isOptional(),"String_Node_Str");
  this.fieldDefinitions=new HashMap<>();
  for (  FieldDefinition field : fieldDefinitions) {
    this.fieldDefinitions.put(field.getFieldName(),field);
  }
  this.cronConstraints=Collections.unmodifiableSet(cronConstraints);
  this.strictRanges=strictRanges;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param fieldDefinitions - list with field definitions. Must not be null or empty.Throws a NullPointerException if a null values is received Throws an IllegalArgumentException if an empty list is received
 */
public CronDefinition(List<FieldDefinition> fieldDefinitions,Set<CronConstraint> cronConstraints,boolean strictRanges,boolean matchDayOfWeekAndDayOfMonth){
  Preconditions.checkNotNull(fieldDefinitions,"String_Node_Str");
  Preconditions.checkNotNull(cronConstraints,"String_Node_Str");
  Preconditions.checkNotNullNorEmpty(fieldDefinitions,"String_Node_Str");
  Preconditions.checkArgument(!fieldDefinitions.get(0).isOptional(),"String_Node_Str");
  this.fieldDefinitions=new HashMap<>();
  for (  FieldDefinition field : fieldDefinitions) {
    this.fieldDefinitions.put(field.getFieldName(),field);
  }
  this.cronConstraints=Collections.unmodifiableSet(cronConstraints);
  this.strictRanges=strictRanges;
  this.matchDayOfWeekAndDayOfMonth=matchDayOfWeekAndDayOfMonth;
}
Program: 4205
Project: 4205
Buggy source:
/** 
 * Creates a new CronDefinition instance with provided field definitions
 * @return returns CronDefinition instance, never null
 */
public CronDefinition instance(){
  Set<CronConstraint> validations=new HashSet<CronConstraint>();
  validations.addAll(cronConstraints);
  return new CronDefinition(fields.values().stream().sorted((o1,o2) -> o1.getFieldName().getOrder() - o2.getFieldName().getOrder()).collect(Collectors.toList()),validations,enforceStrictRanges);
}

Fixed version (ground truth):
/** 
 * Creates a new CronDefinition instance with provided field definitions
 * @return returns CronDefinition instance, never null
 */
public CronDefinition instance(){
  Set<CronConstraint> validations=new HashSet<CronConstraint>();
  validations.addAll(cronConstraints);
  return new CronDefinition(fields.values().stream().sorted((o1,o2) -> o1.getFieldName().getOrder() - o2.getFieldName().getOrder()).collect(Collectors.toList()),validations,enforceStrictRanges,matchDayOfWeekAndDayOfMonth);
}