Program: 14260
Project: 14260
Buggy source:
public CreateStackResponseType createStack(CreateStackType request) throws CloudFormationException {
  CreateStackResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    Account account=ctx.getAccount();
    User user=account.lookupUserByName(User.ACCOUNT_ADMIN);
    String stackName=request.getStackName();
    String templateBody=request.getTemplateBody();
    if (stackName == null)     throw new ValidationErrorException("String_Node_Str");
    if (templateBody == null)     throw new ValidationErrorException("String_Node_Str");
    List<Parameter> parameters=null;
    if (request.getParameters() != null && request.getParameters().getMember() != null) {
      parameters=request.getParameters().getMember();
    }
    Template template=new TemplateParser().parse(templateBody,parameters);
    for (    Resource resource : template.getResourceList()) {
      resource.setOwnerUserId(user.getUserId());
    }
    Stack stack=new Stack();
    stack.setStackName(stackName);
    stack.setStackId(UUID.randomUUID().toString());
    stack.setDescription(template.getDescription());
    ArrayList<Parameter> templateParameters=Lists.newArrayList();
    for (    Template.Parameter templateParameter : template.getParameterList()) {
      Parameter parameter=new Parameter();
      parameter.setParameterValue(templateParameter.getParameterValue());
      parameter.setParameterKey(templateParameter.getParameterKey());
    }
    Parameters stackParameters=new Parameters();
    stackParameters.setMember(templateParameters);
    stack.setParameters(stackParameters);
    stack.setStackStatus(StackEntity.Status.CREATE_IN_PROGRESS.toString());
    stack.setStackStatusReason("String_Node_Str");
    StackEntityManager.addStack(stack);
    new StackCreator(stack,templateBody,template).start();
    CreateStackResult createStackResult=new CreateStackResult();
    createStackResult.setStackId(stack.getStackId());
    reply.setCreateStackResult(createStackResult);
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
  return reply;
}

Fixed version (ground truth):
public CreateStackResponseType createStack(CreateStackType request) throws CloudFormationException {
  CreateStackResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    Account account=ctx.getAccount();
    User user=account.lookupUserByName(User.ACCOUNT_ADMIN);
    String stackName=request.getStackName();
    String templateBody=request.getTemplateBody();
    if (stackName == null)     throw new ValidationErrorException("String_Node_Str");
    if (templateBody == null)     throw new ValidationErrorException("String_Node_Str");
    List<Parameter> parameters=null;
    if (request.getParameters() != null && request.getParameters().getMember() != null) {
      parameters=request.getParameters().getMember();
    }
    Template template=new TemplateParser().parse(templateBody,parameters);
    for (    Resource resource : template.getResourceList()) {
      resource.setOwnerUserId(user.getUserId());
    }
    Stack stack=new Stack();
    stack.setStackName(stackName);
    stack.setStackId(UUID.randomUUID().toString());
    stack.setDescription(template.getDescription());
    ArrayList<Parameter> templateParameters=Lists.newArrayList();
    for (    Template.Parameter templateParameter : template.getParameterList()) {
      Parameter parameter=new Parameter();
      parameter.setParameterValue(templateParameter.getParameterValue());
      parameter.setParameterKey(templateParameter.getParameterKey());
    }
    Parameters stackParameters=new Parameters();
    stackParameters.setMember(templateParameters);
    stack.setParameters(stackParameters);
    stack.setStackStatus(StackEntity.Status.CREATE_IN_PROGRESS.toString());
    stack.setStackStatusReason("String_Node_Str");
    stack.setDisableRollback(true);
    StackEntityManager.addStack(stack);
    new StackCreator(stack,templateBody,template).start();
    CreateStackResult createStackResult=new CreateStackResult();
    createStackResult.setStackId(stack.getStackId());
    reply.setCreateStackResult(createStackResult);
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
  }
  return reply;
}