Program: 5085
Project: 5085
Buggy source:
private void testDeleteSchedule(ApplicationId appV2Id,String scheduleName) throws Exception {
  HttpResponse response=deleteSchedule(TEST_NAMESPACE1,"String_Node_Str",null,scheduleName);
  Assert.assertEquals(HttpResponseStatus.NOT_FOUND.getCode(),response.getStatusLine().getStatusCode());
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,null,"String_Node_Str");
  Assert.assertEquals(HttpResponseStatus.NOT_FOUND.getCode(),response.getStatusLine().getStatusCode());
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,null,scheduleName);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  List<ScheduleSpecification> schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(1,schedules.size());
  schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(2,schedules.size());
  boolean foundSchedule=false;
  for (  ScheduleSpecification schedule : schedules) {
    if (schedule.getSchedule().getName().equals(scheduleName)) {
      foundSchedule=true;
    }
  }
  Assert.assertTrue(String.format("String_Node_Str",scheduleName),foundSchedule);
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),scheduleName);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(1,schedules.size());
}

Fixed version (ground truth):
private void testDeleteSchedule(ApplicationId appV2Id,String scheduleName) throws Exception {
  HttpResponse response=deleteSchedule(TEST_NAMESPACE1,"String_Node_Str",null,scheduleName);
  Assert.assertEquals(HttpResponseStatus.NOT_FOUND.getCode(),response.getStatusLine().getStatusCode());
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,null,"String_Node_Str");
  Assert.assertEquals(HttpResponseStatus.NOT_FOUND.getCode(),response.getStatusLine().getStatusCode());
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,null,scheduleName);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  List<ScheduleSpecification> schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(1,schedules.size());
  schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(3,schedules.size());
  boolean foundSchedule=false;
  for (  ScheduleSpecification schedule : schedules) {
    if (schedule.getSchedule().getName().equals(scheduleName)) {
      foundSchedule=true;
    }
  }
  Assert.assertTrue(String.format("String_Node_Str",scheduleName),foundSchedule);
  response=deleteSchedule(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),scheduleName);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  schedules=getSchedules(TEST_NAMESPACE1,AppWithSchedule.NAME,appV2Id.getVersion(),AppWithSchedule.WORKFLOW_NAME);
  Assert.assertEquals(2,schedules.size());
}