Program: 167399
Project: 167399
Buggy source:
private void deploy(final AgentDeployment deployment){
  DeploymentStatus status=deployment.getDeploymentStatus();
  if (!status.equals(DeploymentStatus.DISABLED) && !status.equals(DeploymentStatus.REQUEST_DISABLE) && !status.equals(DeploymentStatus.REQUEST_UNDEPLOY)) {
    try {
      log.info("String_Node_Str",deployment.getFlow().toString(),agent.getName());
      deployResources(deployment.getFlow());
      if (deployment.asStartType() == StartType.ON_DEPLOY) {
        scheduleNow(deployment);
      }
 else       if (deployment.asStartType() == StartType.SCHEDULED_CRON) {
        String cron=deployment.getStartExpression();
        log.info("String_Node_Str",new Object[]{deployment.getFlow().toString(),agent.getName(),cron,new CronSequenceGenerator(cron).next(new Date())});
        ScheduledFuture<?> future=this.flowExecutionScheduler.schedule(new FlowRunner(deployment,UUID.randomUUID().toString()),new CronTrigger(cron));
        scheduledDeployments.put(deployment,future);
      }
      deployment.setStatus(DeploymentStatus.DEPLOYED.name());
      deployment.setMessage("String_Node_Str");
      scheduledFlows.put(deployment,Collections.synchronizedList(new ArrayList<FlowRuntime>()));
      log.info("String_Node_Str",deployment.getFlow().getName());
    }
 catch (    Exception e) {
      log.warn("String_Node_Str",deployment.getFlow().getName(),e);
      deployment.setStatus(DeploymentStatus.ERROR.name());
      deployment.setMessage(ExceptionUtils.getRootCauseMessage(e));
    }
    configurationService.save(deployment);
  }
}

Fixed version (ground truth):
private void deploy(final AgentDeployment deployment){
  DeploymentStatus status=deployment.getDeploymentStatus();
  if (!status.equals(DeploymentStatus.DISABLED) && !status.equals(DeploymentStatus.REQUEST_DISABLE) && !status.equals(DeploymentStatus.REQUEST_UNDEPLOY)) {
    try {
      log.info("String_Node_Str",deployment.getFlow().toString(),agent.getName());
      deployResources(deployment.getFlow());
      if (scheduledFlows.get(deployment) == null) {
        scheduledFlows.put(deployment,Collections.synchronizedList(new ArrayList<FlowRuntime>()));
      }
      if (deployment.asStartType() == StartType.ON_DEPLOY) {
        scheduleNow(deployment);
      }
 else       if (deployment.asStartType() == StartType.SCHEDULED_CRON) {
        String cron=deployment.getStartExpression();
        log.info("String_Node_Str",new Object[]{deployment.getFlow().toString(),agent.getName(),cron,new CronSequenceGenerator(cron).next(new Date())});
        ScheduledFuture<?> future=this.flowExecutionScheduler.schedule(new FlowRunner(deployment,UUID.randomUUID().toString()),new CronTrigger(cron));
        scheduledDeployments.put(deployment,future);
      }
      deployment.setStatus(DeploymentStatus.DEPLOYED.name());
      deployment.setMessage("String_Node_Str");
      log.info("String_Node_Str",deployment.getFlow().getName());
    }
 catch (    Exception e) {
      log.warn("String_Node_Str",deployment.getFlow().getName(),e);
      deployment.setStatus(DeploymentStatus.ERROR.name());
      deployment.setMessage(ExceptionUtils.getRootCauseMessage(e));
    }
    configurationService.save(deployment);
  }
}