Program: 14072
Project: 14072
Buggy source:
@Override public StackEntity get(){
  try {
    StackEntity stackEntity=new StackEntity();
    final int INIT_STACK_VERSION=0;
    StackEntityHelper.populateStackEntityWithTemplate(stackEntity,template);
    stackEntity.setStackName(stackName);
    stackEntity.setStackId(stackId);
    stackEntity.setAccountId(accountId);
    stackEntity.setTemplateBody(templateText);
    stackEntity.setStackPolicy(stackPolicyText);
    stackEntity.setStackStatus(Status.CREATE_IN_PROGRESS);
    stackEntity.setStackStatusReason("String_Node_Str");
    stackEntity.setDisableRollback(request.getDisableRollback() == Boolean.TRUE);
    stackEntity.setCreationTimestamp(new Date());
    if (request.getCapabilities() != null && request.getCapabilities().getMember() != null) {
      stackEntity.setCapabilitiesJson(StackEntityHelper.capabilitiesToJson(capabilities));
    }
    if (request.getNotificationARNs() != null && request.getNotificationARNs().getMember() != null) {
      stackEntity.setNotificationARNsJson(StackEntityHelper.notificationARNsToJson(request.getNotificationARNs().getMember()));
    }
    if (request.getTags() != null && request.getTags().getMember() != null) {
      stackEntity.setTagsJson(StackEntityHelper.tagsToJson(request.getTags().getMember()));
    }
    stackEntity.setStackVersion(INIT_STACK_VERSION);
    stackEntity.setRecordDeleted(Boolean.FALSE);
    stackEntity=(StackEntity)StackEntityManager.addStack(stackEntity);
    String onFailure;
    if (request.getOnFailure() != null && !request.getOnFailure().isEmpty()) {
      if (!request.getOnFailure().equals("String_Node_Str") && !request.getOnFailure().equals("String_Node_Str") && !request.getOnFailure().equals("String_Node_Str")) {
        throw new ValidationErrorException("String_Node_Str" + request.getOnFailure() + "String_Node_Str"+ "String_Node_Str");
      }
 else {
        onFailure=request.getOnFailure();
      }
    }
 else {
      onFailure=(request.getDisableRollback() == Boolean.TRUE) ? "String_Node_Str" : "String_Node_Str";
    }
    for (    ResourceInfo resourceInfo : template.getResourceInfoMap().values()) {
      StackResourceEntity stackResourceEntity=new StackResourceEntity();
      stackResourceEntity=StackResourceEntityManager.updateResourceInfo(stackResourceEntity,resourceInfo);
      stackResourceEntity.setDescription("String_Node_Str");
      stackResourceEntity.setResourceStatus(Status.NOT_STARTED);
      stackResourceEntity.setStackId(stackId);
      stackResourceEntity.setStackName(stackName);
      stackResourceEntity.setResourceVersion(INIT_STACK_VERSION);
      stackResourceEntity.setRecordDeleted(Boolean.FALSE);
      StackResourceEntityManager.addStackResource(stackResourceEntity);
    }
    StackWorkflowTags stackWorkflowTags=new StackWorkflowTags(stackId,stackName,accountId,accountAlias);
    Long timeoutInSeconds=(request.getTimeoutInMinutes() != null && request.getTimeoutInMinutes() > 0 ? 60L * request.getTimeoutInMinutes() : null);
    StartTimeoutPassableWorkflowClientFactory createStackWorkflowClientFactory=new StartTimeoutPassableWorkflowClientFactory(WorkflowClientManager.getSimpleWorkflowClient(),CloudFormationProperties.SWF_DOMAIN,CloudFormationProperties.SWF_TASKLIST);
    WorkflowDescriptionTemplate createStackWorkflowDescriptionTemplate=new CreateStackWorkflowDescriptionTemplate();
    InterfaceBasedWorkflowClient<CreateStackWorkflow> createStackWorkflowClient=createStackWorkflowClientFactory.getNewWorkflowClient(CreateStackWorkflow.class,createStackWorkflowDescriptionTemplate,stackWorkflowTags,timeoutInSeconds,null);
    CreateStackWorkflow createStackWorkflow=new CreateStackWorkflowClient(createStackWorkflowClient);
    createStackWorkflow.createStack(stackEntity.getStackId(),stackEntity.getAccountId(),stackEntity.getResourceDependencyManagerJson(),userId,onFailure,INIT_STACK_VERSION);
    StackWorkflowEntityManager.addOrUpdateStackWorkflowEntity(stackId,StackWorkflowEntity.WorkflowType.CREATE_STACK_WORKFLOW,CloudFormationProperties.SWF_DOMAIN,createStackWorkflowClient.getWorkflowExecution().getWorkflowId(),createStackWorkflowClient.getWorkflowExecution().getRunId());
    WorkflowClientFactory monitorCreateStackWorkflowClientFactory=new WorkflowClientFactory(WorkflowClientManager.getSimpleWorkflowClient(),CloudFormationProperties.SWF_DOMAIN,CloudFormationProperties.SWF_TASKLIST);
    WorkflowDescriptionTemplate monitorCreateStackWorkflowDescriptionTemplate=new MonitorCreateStackWorkflowDescriptionTemplate();
    InterfaceBasedWorkflowClient<MonitorCreateStackWorkflow> monitorCreateStackWorkflowClient=monitorCreateStackWorkflowClientFactory.getNewWorkflowClient(MonitorCreateStackWorkflow.class,monitorCreateStackWorkflowDescriptionTemplate,stackWorkflowTags);
    MonitorCreateStackWorkflow monitorCreateStackWorkflow=new MonitorCreateStackWorkflowClient(monitorCreateStackWorkflowClient);
    monitorCreateStackWorkflow.monitorCreateStack(stackEntity.getStackId(),stackEntity.getAccountId(),stackEntity.getResourceDependencyManagerJson(),userId,onFailure,INIT_STACK_VERSION);
    StackWorkflowEntityManager.addOrUpdateStackWorkflowEntity(stackId,StackWorkflowEntity.WorkflowType.MONITOR_CREATE_STACK_WORKFLOW,CloudFormationProperties.SWF_DOMAIN,monitorCreateStackWorkflowClient.getWorkflowExecution().getWorkflowId(),monitorCreateStackWorkflowClient.getWorkflowExecution().getRunId());
    return stackEntity;
  }
 catch (  CloudFormationException e) {
    throw Exceptions.toUndeclared(e);
  }
}

Fixed version (ground truth):
@Override public StackEntity get(){
  try {
    StackEntity stackEntity=new StackEntity();
    final int INIT_STACK_VERSION=0;
    StackEntityHelper.populateStackEntityWithTemplate(stackEntity,template);
    stackEntity.setStackName(stackName);
    stackEntity.setStackId(stackId);
    stackEntity.setAccountId(accountId);
    stackEntity.setTemplateBody(templateText);
    stackEntity.setStackPolicy(stackPolicyText);
    stackEntity.setStackStatus(Status.CREATE_IN_PROGRESS);
    stackEntity.setStackStatusReason("String_Node_Str");
    stackEntity.setDisableRollback(Boolean.TRUE.equals(request.getDisableRollback()));
    stackEntity.setCreationTimestamp(new Date());
    if (request.getCapabilities() != null && request.getCapabilities().getMember() != null) {
      stackEntity.setCapabilitiesJson(StackEntityHelper.capabilitiesToJson(capabilities));
    }
    if (request.getNotificationARNs() != null && request.getNotificationARNs().getMember() != null) {
      stackEntity.setNotificationARNsJson(StackEntityHelper.notificationARNsToJson(request.getNotificationARNs().getMember()));
    }
    if (request.getTags() != null && request.getTags().getMember() != null) {
      stackEntity.setTagsJson(StackEntityHelper.tagsToJson(request.getTags().getMember()));
    }
    stackEntity.setStackVersion(INIT_STACK_VERSION);
    stackEntity.setRecordDeleted(Boolean.FALSE);
    stackEntity=(StackEntity)StackEntityManager.addStack(stackEntity);
    String onFailure;
    if (request.getOnFailure() != null && !request.getOnFailure().isEmpty()) {
      if (!request.getOnFailure().equals("String_Node_Str") && !request.getOnFailure().equals("String_Node_Str") && !request.getOnFailure().equals("String_Node_Str")) {
        throw new ValidationErrorException("String_Node_Str" + request.getOnFailure() + "String_Node_Str"+ "String_Node_Str");
      }
 else {
        onFailure=request.getOnFailure();
      }
    }
 else {
      onFailure=(Boolean.TRUE.equals(request.getDisableRollback())) ? "String_Node_Str" : "String_Node_Str";
    }
    for (    ResourceInfo resourceInfo : template.getResourceInfoMap().values()) {
      StackResourceEntity stackResourceEntity=new StackResourceEntity();
      stackResourceEntity=StackResourceEntityManager.updateResourceInfo(stackResourceEntity,resourceInfo);
      stackResourceEntity.setDescription("String_Node_Str");
      stackResourceEntity.setResourceStatus(Status.NOT_STARTED);
      stackResourceEntity.setStackId(stackId);
      stackResourceEntity.setStackName(stackName);
      stackResourceEntity.setResourceVersion(INIT_STACK_VERSION);
      stackResourceEntity.setRecordDeleted(Boolean.FALSE);
      StackResourceEntityManager.addStackResource(stackResourceEntity);
    }
    StackWorkflowTags stackWorkflowTags=new StackWorkflowTags(stackId,stackName,accountId,accountAlias);
    Long timeoutInSeconds=(request.getTimeoutInMinutes() != null && request.getTimeoutInMinutes() > 0 ? 60L * request.getTimeoutInMinutes() : null);
    StartTimeoutPassableWorkflowClientFactory createStackWorkflowClientFactory=new StartTimeoutPassableWorkflowClientFactory(WorkflowClientManager.getSimpleWorkflowClient(),CloudFormationProperties.SWF_DOMAIN,CloudFormationProperties.SWF_TASKLIST);
    WorkflowDescriptionTemplate createStackWorkflowDescriptionTemplate=new CreateStackWorkflowDescriptionTemplate();
    InterfaceBasedWorkflowClient<CreateStackWorkflow> createStackWorkflowClient=createStackWorkflowClientFactory.getNewWorkflowClient(CreateStackWorkflow.class,createStackWorkflowDescriptionTemplate,stackWorkflowTags,timeoutInSeconds,null);
    CreateStackWorkflow createStackWorkflow=new CreateStackWorkflowClient(createStackWorkflowClient);
    createStackWorkflow.createStack(stackEntity.getStackId(),stackEntity.getAccountId(),stackEntity.getResourceDependencyManagerJson(),userId,onFailure,INIT_STACK_VERSION);
    StackWorkflowEntityManager.addOrUpdateStackWorkflowEntity(stackId,StackWorkflowEntity.WorkflowType.CREATE_STACK_WORKFLOW,CloudFormationProperties.SWF_DOMAIN,createStackWorkflowClient.getWorkflowExecution().getWorkflowId(),createStackWorkflowClient.getWorkflowExecution().getRunId());
    WorkflowClientFactory monitorCreateStackWorkflowClientFactory=new WorkflowClientFactory(WorkflowClientManager.getSimpleWorkflowClient(),CloudFormationProperties.SWF_DOMAIN,CloudFormationProperties.SWF_TASKLIST);
    WorkflowDescriptionTemplate monitorCreateStackWorkflowDescriptionTemplate=new MonitorCreateStackWorkflowDescriptionTemplate();
    InterfaceBasedWorkflowClient<MonitorCreateStackWorkflow> monitorCreateStackWorkflowClient=monitorCreateStackWorkflowClientFactory.getNewWorkflowClient(MonitorCreateStackWorkflow.class,monitorCreateStackWorkflowDescriptionTemplate,stackWorkflowTags);
    MonitorCreateStackWorkflow monitorCreateStackWorkflow=new MonitorCreateStackWorkflowClient(monitorCreateStackWorkflowClient);
    monitorCreateStackWorkflow.monitorCreateStack(stackEntity.getStackId(),stackEntity.getAccountId(),stackEntity.getResourceDependencyManagerJson(),userId,onFailure,INIT_STACK_VERSION);
    StackWorkflowEntityManager.addOrUpdateStackWorkflowEntity(stackId,StackWorkflowEntity.WorkflowType.MONITOR_CREATE_STACK_WORKFLOW,CloudFormationProperties.SWF_DOMAIN,monitorCreateStackWorkflowClient.getWorkflowExecution().getWorkflowId(),monitorCreateStackWorkflowClient.getWorkflowExecution().getRunId());
    return stackEntity;
  }
 catch (  CloudFormationException e) {
    throw Exceptions.toUndeclared(e);
  }
}