Program: 6587
Project: 6587
Buggy source:
private void suspendResumeSchedule(HttpResponder responder,String namespaceId,String appId,String scheduleName,String action){
  try {
    if (!action.equals("String_Node_Str") && !action.equals("String_Node_Str")) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
      return;
    }
    ApplicationSpecification appSpec=store.getApplication(Id.Application.from(namespaceId,appId));
    if (appSpec == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str" + appId + "String_Node_Str");
      return;
    }
    ScheduleSpecification scheduleSpec=appSpec.getSchedules().get(scheduleName);
    if (scheduleSpec == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str" + scheduleName + "String_Node_Str");
      return;
    }
    String programName=scheduleSpec.getProgram().getProgramName();
    ProgramType programType=ProgramType.valueOfSchedulableType(scheduleSpec.getProgram().getProgramType());
    Id.Program programId=Id.Program.from(namespaceId,appId,programType,programName);
    Scheduler.ScheduleState state=scheduler.scheduleState(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
switch (state) {
case NOT_FOUND:
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    break;
case SCHEDULED:
  if (action.equals("String_Node_Str")) {
    scheduler.suspendSchedule(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
    responder.sendJson(HttpResponseStatus.OK,"String_Node_Str");
  }
 else {
    responder.sendJson(HttpResponseStatus.CONFLICT,"String_Node_Str");
  }
break;
case SUSPENDED:
if (action.equals("String_Node_Str")) {
responder.sendJson(HttpResponseStatus.CONFLICT,"String_Node_Str");
}
 else {
scheduler.resumeSchedule(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
responder.sendJson(HttpResponseStatus.OK,"String_Node_Str");
}
break;
}
}
 catch (SecurityException e) {
responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
}
catch (NotFoundException e) {
responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
}
catch (Throwable e) {
LOG.error("String_Node_Str",action,scheduleName,appId,e);
responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
}
}

Fixed version (ground truth):
private void suspendResumeSchedule(HttpResponder responder,String namespaceId,String appId,String scheduleName,String action) throws SchedulerException {
  try {
    if (!action.equals("String_Node_Str") && !action.equals("String_Node_Str")) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
      return;
    }
    ApplicationSpecification appSpec=store.getApplication(Id.Application.from(namespaceId,appId));
    if (appSpec == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str" + appId + "String_Node_Str");
      return;
    }
    ScheduleSpecification scheduleSpec=appSpec.getSchedules().get(scheduleName);
    if (scheduleSpec == null) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str" + scheduleName + "String_Node_Str");
      return;
    }
    String programName=scheduleSpec.getProgram().getProgramName();
    ProgramType programType=ProgramType.valueOfSchedulableType(scheduleSpec.getProgram().getProgramType());
    Id.Program programId=Id.Program.from(namespaceId,appId,programType,programName);
    Scheduler.ScheduleState state=scheduler.scheduleState(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
switch (state) {
case NOT_FOUND:
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    break;
case SCHEDULED:
  if (action.equals("String_Node_Str")) {
    scheduler.suspendSchedule(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
    responder.sendJson(HttpResponseStatus.OK,"String_Node_Str");
  }
 else {
    responder.sendJson(HttpResponseStatus.CONFLICT,"String_Node_Str");
  }
break;
case SUSPENDED:
if (action.equals("String_Node_Str")) {
responder.sendJson(HttpResponseStatus.CONFLICT,"String_Node_Str");
}
 else {
scheduler.resumeSchedule(programId,scheduleSpec.getProgram().getProgramType(),scheduleName);
responder.sendJson(HttpResponseStatus.OK,"String_Node_Str");
}
break;
}
}
 catch (SecurityException e) {
responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
}
catch (NotFoundException e) {
responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
}
}