nus-yam/ex-repair huggingface dataset:
Program: 63999
Project: 63999
Buggy source:
@Override public boolean checkStatus(GccResourceReadyPollerObject gccResourceReadyPollerObject){
  MDCBuilder.buildMdcContext(gccResourceReadyPollerObject.getStack());
  LOGGER.info("String_Node_Str",gccResourceReadyPollerObject.getName());
  Operation execute=null;
  try {
    execute=gccResourceReadyPollerObject.getZoneOperations().execute();
    if (execute.getHttpErrorStatusCode() != null) {
      throw new GccResourceCreationException(String.format("String_Node_Str",gccResourceReadyPollerObject.getName(),gccResourceReadyPollerObject.getOperationName(),gccResourceReadyPollerObject.getStack().getId()));
    }
 else {
      Integer progress=execute.getProgress();
      return (progress.intValue() != FINISHED) ? false : true;
    }
  }
 catch (  IOException e) {
    throw new GccResourceCreationException(String.format("String_Node_Str",gccResourceReadyPollerObject.getName(),gccResourceReadyPollerObject.getOperationName(),gccResourceReadyPollerObject.getStack().getId()));
  }
}

Fixed version (ground truth):
@Override public boolean checkStatus(GccResourceReadyPollerObject gccResourceReadyPollerObject){
  MDCBuilder.buildMdcContext(gccResourceReadyPollerObject.getStack());
  LOGGER.info("String_Node_Str",gccResourceReadyPollerObject.getName());
  Operation execute=null;
  try {
    execute=gccResourceReadyPollerObject.getZoneOperations().execute();
    if (execute.getHttpErrorStatusCode() != null) {
      throw new GccResourceCreationException(String.format("String_Node_Str",gccResourceReadyPollerObject.getName(),gccResourceReadyPollerObject.getOperationName(),gccResourceReadyPollerObject.getStack().getId(),execute.getHttpErrorMessage()));
    }
 else {
      Integer progress=execute.getProgress();
      return (progress.intValue() != FINISHED) ? false : true;
    }
  }
 catch (  IOException e) {
    throw new GccResourceCreationException(String.format("String_Node_Str",gccResourceReadyPollerObject.getName(),gccResourceReadyPollerObject.getOperationName(),gccResourceReadyPollerObject.getStack().getId(),execute.getHttpErrorMessage()));
  }
}
Program: 64000
Project: 64000
Buggy source:
@Override public Blueprint getPublicBlueprint(String name,CbUser user){
  Blueprint blueprint=blueprintRepository.findByNameInAccount(name,user.getAccount(),user.getUserId());
  if (blueprint == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
  return blueprint;
}

Fixed version (ground truth):
@Override public Blueprint getPublicBlueprint(String name,CbUser user){
  Blueprint blueprint=blueprintRepository.findOneByName(name);
  if (blueprint == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
  return blueprint;
}
Program: 64001
Project: 64001
Buggy source:
@Override public Credential getPublicBlueprint(String name,CbUser user){
  Credential credential=credentialRepository.findByNameInAccount(name,user.getAccount(),user.getUserId());
  if (credential == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
 else {
    return credential;
  }
}

Fixed version (ground truth):
@Override public Credential getPublicBlueprint(String name,CbUser user){
  Credential credential=credentialRepository.findOneByName(name);
  if (credential == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
 else {
    return credential;
  }
}
Program: 64002
Project: 64002
Buggy source:
public Stack getPublicStack(String name,CbUser cbUser){
  Stack stack=stackRepository.findByNameInAccount(name,cbUser.getAccount(),cbUser.getUserId());
  if (stack == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
  MDCBuilder.buildMdcContext(stack);
  return stack;
}

Fixed version (ground truth):
public Stack getPublicStack(String name,CbUser cbUser){
  Stack stack=stackRepository.findOneByName(name);
  if (stack == null) {
    throw new NotFoundException(String.format("String_Node_Str",name));
  }
  MDCBuilder.buildMdcContext(stack);
  return stack;
}
Program: 64003
Project: 64003
Buggy source:
public Template getPublicTemplate(String name,CbUser user){
  Template template=templateRepository.findByNameInAccount(name,user.getAccount(),user.getUserId());
  if (template == null) {
    throw new NotFoundException(String.format(TEMPLATE_NOT_FOUND_MSG,name));
  }
 else {
    MDCBuilder.buildMdcContext(template);
    return template;
  }
}

Fixed version (ground truth):
public Template getPublicTemplate(String name,CbUser user){
  Template template=templateRepository.findOneByName(name);
  if (template == null) {
    throw new NotFoundException(String.format(TEMPLATE_NOT_FOUND_MSG,name));
  }
 else {
    MDCBuilder.buildMdcContext(template);
    return template;
  }
}
Program: 64004
Project: 64004
Buggy source:
@Override public Credential create(CbUser user,Credential credential){
  MDCBuilder.buildMdcContext(credential);
  LOGGER.debug("String_Node_Str",user.getUsername(),user.getAccount());
  Credential savedCredential=null;
  credential.setOwner(user.getUserId());
  credential.setAccount(user.getAccount());
  try {
    savedCredential=credentialRepository.save(credential);
  }
 catch (  DataIntegrityViolationException ex) {
    throw new DuplicateKeyValueException(credential.getName(),ex);
  }
  createAzureCertificates(user,savedCredential);
  return savedCredential;
}

Fixed version (ground truth):
@Override public Credential create(CbUser user,Credential credential){
  MDCBuilder.buildMdcContext(credential);
  LOGGER.debug("String_Node_Str",user.getUsername(),user.getAccount());
  Credential savedCredential=null;
  credential.setOwner(user.getUserId());
  credential.setAccount(user.getAccount());
  try {
    savedCredential=credentialRepository.save(credential);
  }
 catch (  DataIntegrityViolationException ex) {
    throw new DuplicateKeyValueException(credential.getName(),ex);
  }
  return savedCredential;
}
Program: 64005
Project: 64005
Buggy source:
private void validateBlueprint(String blueprintText){
  try {
    ObjectMapper mapper=new ObjectMapper();
    JsonNode root=mapper.readTree(blueprintText);
    hasBlueprintInBlueprint(root);
    hasBlueprintNameInBlueprint(root);
    hasHostGroupInBlueprint(root);
    new AmbariClient().validateBlueprint(blueprintText);
  }
 catch (  InvalidBlueprintException e) {
    throw new BadRequestException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new BadRequestException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void validateBlueprint(String blueprintText){
  try {
    ObjectMapper mapper=new ObjectMapper();
    JsonNode root=mapper.readTree(blueprintText);
    hasBlueprintInBlueprint(root);
    hasBlueprintNameInBlueprint(root);
    hasHostGroupInBlueprint(root);
    new AmbariClient().validateBlueprint(blueprintText);
  }
 catch (  InvalidBlueprintException e) {
    throw new BadRequestException("String_Node_Str" + e.getMessage(),e);
  }
catch (  IOException e) {
    throw new BadRequestException("String_Node_Str",e);
  }
}
Program: 64006
Project: 64006
Buggy source:
private void deleteNetwork(Stack stack,Compute compute){
  for (  Resource resource : stack.getResourcesByType(ResourceType.NETWORK)) {
    try {
      gccStackUtil.removeNetwork(compute,stack,resource.getResourceName());
    }
 catch (    GoogleJsonResponseException ex) {
      gccStackUtil.exceptionHandler(ex,resource.getResourceName());
    }
catch (    IOException e) {
      throw new InternalServerException(e.getMessage());
    }
  }
}

Fixed version (ground truth):
private void deleteNetwork(Stack stack,Compute compute){
  for (  Resource resource : stack.getResourcesByType(ResourceType.FIREWALL)) {
    try {
      gccStackUtil.removeFireWall(compute,stack,resource.getResourceName());
    }
 catch (    GoogleJsonResponseException ex) {
      gccStackUtil.exceptionHandler(ex,resource.getResourceName());
    }
catch (    IOException e) {
      throw new InternalServerException(e.getMessage());
    }
  }
  for (  Resource resource : stack.getResourcesByType(ResourceType.NETWORK)) {
    try {
      gccStackUtil.removeNetwork(compute,stack,resource.getResourceName());
    }
 catch (    GoogleJsonResponseException ex) {
      gccStackUtil.exceptionHandler(ex,resource.getResourceName());
    }
catch (    IOException e) {
      throw new InternalServerException(e.getMessage());
    }
  }
}
Program: 64008
Project: 64008
Buggy source:
@Override public boolean checkStatus(GccRemoveReadyPollerObject gccRemoveReadyPollerObject){
  LOGGER.info("String_Node_Str",gccRemoveReadyPollerObject.getName(),gccRemoveReadyPollerObject.getStack().getId());
  GccTemplate gccTemplate=(GccTemplate)gccRemoveReadyPollerObject.getStack().getTemplate();
  GccCredential gccCredential=(GccCredential)gccRemoveReadyPollerObject.getStack().getCredential();
  try {
    Integer progress=gccRemoveReadyPollerObject.getCompute().globalOperations().get(gccCredential.getProjectId(),gccRemoveReadyPollerObject.getOperation().getName()).execute().getProgress();
    return (progress.intValue() != FINISHED) ? false : true;
  }
 catch (  GoogleJsonResponseException ex) {
    return exceptionHandler(ex,gccRemoveReadyPollerObject.getName());
  }
catch (  NullPointerException|IOException e) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean checkStatus(GccRemoveReadyPollerObject gccRemoveReadyPollerObject){
  LOGGER.info("String_Node_Str",gccRemoveReadyPollerObject.getName(),gccRemoveReadyPollerObject.getStack().getId());
  GccTemplate gccTemplate=(GccTemplate)gccRemoveReadyPollerObject.getStack().getTemplate();
  GccCredential gccCredential=(GccCredential)gccRemoveReadyPollerObject.getStack().getCredential();
  try {
    Integer progress=gccRemoveReadyPollerObject.getCompute().zoneOperations().get(gccCredential.getProjectId(),gccTemplate.getGccZone().getValue(),gccRemoveReadyPollerObject.getOperation().getName()).execute().getProgress();
    return (progress.intValue() != FINISHED) ? false : true;
  }
 catch (  GoogleJsonResponseException ex) {
    return exceptionHandler(ex,gccRemoveReadyPollerObject);
  }
catch (  NullPointerException|IOException e) {
    return false;
  }
}
Program: 64009
Project: 64009
Buggy source:
private boolean exceptionHandler(GoogleJsonResponseException ex,String name){
  if (ex.getDetails().get("String_Node_Str").equals(NOT_FOUND)) {
    LOGGER.info(String.format("String_Node_Str",name));
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean exceptionHandler(GoogleJsonResponseException ex,GccRemoveReadyPollerObject gccRemoveReadyPollerObject){
  if (ex.getDetails().get("String_Node_Str").equals(NOT_FOUND)) {
    GccCredential gccCredential=(GccCredential)gccRemoveReadyPollerObject.getStack().getCredential();
    try {
      Integer progress=gccRemoveReadyPollerObject.getCompute().globalOperations().get(gccCredential.getProjectId(),gccRemoveReadyPollerObject.getOperation().getName()).execute().getProgress();
      return (progress.intValue() != FINISHED) ? false : true;
    }
 catch (    IOException e) {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 64010
Project: 64010
Buggy source:
public List<AttachedDisk> buildAttachedDisks(String name,Disk disk,Compute compute,Stack stack) throws IOException {
  GccTemplate gccTemplate=(GccTemplate)stack.getTemplate();
  GccCredential gccCredential=(GccCredential)stack.getCredential();
  List<AttachedDisk> listOfDisks=new ArrayList<>();
  AttachedDisk diskToInsert=new AttachedDisk();
  diskToInsert.setBoot(true);
  diskToInsert.setType(GccDiskType.PERSISTENT.getValue());
  diskToInsert.setMode(GccDiskMode.READ_WRITE.getValue());
  diskToInsert.setDeviceName(name);
  diskToInsert.setSource(String.format("String_Node_Str",gccCredential.getProjectId(),gccTemplate.getGccZone().getValue(),disk.getName(),gccTemplate.getGccZone()));
  listOfDisks.add(diskToInsert);
  for (int i=0; i < gccTemplate.getVolumeCount(); i++) {
    String value=name + i;
    Disk disk1=buildRawDisk(compute,stack,gccCredential.getProjectId(),gccTemplate.getGccZone(),value,Long.parseLong(gccTemplate.getVolumeSize().toString()));
    AttachedDisk diskToInsert1=new AttachedDisk();
    diskToInsert1.setBoot(false);
    diskToInsert1.setType(GccDiskType.PERSISTENT.getValue());
    diskToInsert1.setMode(GccDiskMode.READ_WRITE.getValue());
    diskToInsert1.setDeviceName(value);
    diskToInsert1.setSource(String.format("String_Node_Str",gccCredential.getProjectId(),gccTemplate.getGccZone().getValue(),disk1.getName()));
    listOfDisks.add(diskToInsert1);
  }
  return listOfDisks;
}

Fixed version (ground truth):
public List<AttachedDisk> buildAttachedDisks(String name,Disk disk,Compute compute,Stack stack) throws IOException {
  GccTemplate gccTemplate=(GccTemplate)stack.getTemplate();
  GccCredential gccCredential=(GccCredential)stack.getCredential();
  List<AttachedDisk> listOfDisks=new ArrayList<>();
  AttachedDisk diskToInsert=new AttachedDisk();
  diskToInsert.setBoot(true);
  diskToInsert.setType(GccDiskType.PERSISTENT.getValue());
  diskToInsert.setMode(GccDiskMode.READ_WRITE.getValue());
  diskToInsert.setDeviceName(name);
  diskToInsert.setSource(String.format("String_Node_Str",gccCredential.getProjectId(),gccTemplate.getGccZone().getValue(),disk.getName(),gccTemplate.getGccZone()));
  listOfDisks.add(diskToInsert);
  for (int i=0; i < gccTemplate.getVolumeCount(); i++) {
    String value=name + "String_Node_Str" + i;
    Disk disk1=buildRawDisk(compute,stack,gccCredential.getProjectId(),gccTemplate.getGccZone(),value,Long.parseLong(gccTemplate.getVolumeSize().toString()));
    AttachedDisk diskToInsert1=new AttachedDisk();
    diskToInsert1.setBoot(false);
    diskToInsert1.setType(GccDiskType.PERSISTENT.getValue());
    diskToInsert1.setMode(GccDiskMode.READ_WRITE.getValue());
    diskToInsert1.setDeviceName(value);
    diskToInsert1.setSource(String.format("String_Node_Str",gccCredential.getProjectId(),gccTemplate.getGccZone().getValue(),disk1.getName()));
    listOfDisks.add(diskToInsert1);
  }
  return listOfDisks;
}
Program: 64011
Project: 64011
Buggy source:
@Override public User registerUponInvitation(String inviteToken,User userInput){
  User invitedUser=userRepository.findUserByConfToken(inviteToken);
  if (invitedUser != null) {
    invitedUser.setPassword(passwordEncoder.encode(userInput.getPassword()));
    invitedUser.setFirstName(userInput.getFirstName());
    invitedUser.setLastName(userInput.getLastName());
    invitedUser.setStatus(UserStatus.ACTIVE);
    invitedUser.setRegistrationDate(Calendar.getInstance().getTime());
    invitedUser=userRepository.save(invitedUser);
  }
 else {
    throw new NotFoundException("String_Node_Str" + userInput);
  }
  return invitedUser;
}

Fixed version (ground truth):
@Override public User registerUponInvitation(String inviteToken,User userInput){
  User invitedUser=userRepository.findUserByConfToken(inviteToken);
  if (invitedUser != null) {
    invitedUser.setPassword(passwordEncoder.encode(userInput.getPassword()));
    invitedUser.setFirstName(userInput.getFirstName());
    invitedUser.setLastName(userInput.getLastName());
    invitedUser.setStatus(UserStatus.ACTIVE);
    invitedUser.setConfToken(null);
    invitedUser.setRegistrationDate(Calendar.getInstance().getTime());
    invitedUser=userRepository.save(invitedUser);
  }
 else {
    throw new NotFoundException("String_Node_Str" + userInput);
  }
  return invitedUser;
}
Program: 64012
Project: 64012
Buggy source:
@Override public Set<InstanceMetaData> getMetaData(String hash){
  Stack stack=stackRepository.findStackByHash(hash);
  if (stack != null) {
    if (!stack.isMetadataReady()) {
      throw new MetadataIncompleteException("String_Node_Str");
    }
 else     if (!stack.getInstanceMetaData().isEmpty()) {
      return stack.getInstanceMetaData();
    }
  }
  throw new NotFoundException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Set<InstanceMetaData> getMetaData(String hash){
  Stack stack=stackRepository.findStackByHash(hash);
  if (stack != null) {
    if (!Status.UPDATE_IN_PROGRESS.equals(stack.getStatus())) {
      if (!stack.isMetadataReady()) {
        throw new MetadataIncompleteException("String_Node_Str");
      }
 else       if (!stack.getInstanceMetaData().isEmpty()) {
        return stack.getInstanceMetaData();
      }
    }
 else {
      throw new MetadataIncompleteException("String_Node_Str");
    }
  }
  throw new NotFoundException("String_Node_Str");
}
Program: 64013
Project: 64013
Buggy source:
private void createStorageAccount(AzureClient azureClient,AzureTemplate azureTemplate,String commonName){
  try {
    azureClient.getStorageAccount(commonName);
  }
 catch (  Exception ex) {
    if (((HttpResponseException)ex).getStatusCode() == NOT_FOUND) {
      Map<String,String> props=new HashMap<>();
      props.put(NAME,commonName);
      props.put(DESCRIPTION,azureTemplate.getDescription());
      props.put(AFFINITYGROUP,commonName);
      HttpResponseDecorator storageResponse=(HttpResponseDecorator)azureClient.createStorageAccount(props);
      String requestId=(String)azureClient.getRequestId(storageResponse);
      azureClient.waitUntilComplete(requestId);
    }
 else {
      throw new InternalServerException(ex.getMessage());
    }
  }
}

Fixed version (ground truth):
private void createStorageAccount(Stack stack,AzureClient azureClient,AzureTemplate azureTemplate,String commonName){
  try {
    azureClient.getStorageAccount(commonName);
  }
 catch (  Exception ex) {
    if (((HttpResponseException)ex).getStatusCode() == NOT_FOUND) {
      Map<String,String> props=new HashMap<>();
      props.put(NAME,commonName);
      props.put(DESCRIPTION,azureTemplate.getDescription());
      props.put(AFFINITYGROUP,commonName);
      HttpResponseDecorator storageResponse=(HttpResponseDecorator)azureClient.createStorageAccount(props);
      String requestId=(String)azureClient.getRequestId(storageResponse);
      azureClient.waitUntilComplete(requestId);
    }
 else     if (ex instanceof HttpResponseException) {
      LOGGER.error(String.format("String_Node_Str",stack.getId()),ex);
      throw new InternalServerException(((HttpResponseException)ex).getResponse().toString());
    }
 else {
      LOGGER.error(String.format("String_Node_Str",stack.getId()),ex);
      throw new InternalServerException(ex.getMessage());
    }
  }
}
Program: 64014
Project: 64014
Buggy source:
private void createAffinityGroup(AzureClient azureClient,AzureTemplate azureTemplate,String name){
  try {
    azureClient.getAffinityGroup(name);
  }
 catch (  Exception ex) {
    if (((HttpResponseException)ex).getStatusCode() == NOT_FOUND) {
      Map<String,String> props=new HashMap<>();
      props.put(NAME,name);
      props.put(LOCATION,azureTemplate.getLocation().location());
      props.put(DESCRIPTION,azureTemplate.getDescription());
      HttpResponseDecorator affinityResponse=(HttpResponseDecorator)azureClient.createAffinityGroup(props);
      String requestId=(String)azureClient.getRequestId(affinityResponse);
      azureClient.waitUntilComplete(requestId);
    }
 else {
      throw new InternalServerException(ex.getMessage());
    }
  }
}

Fixed version (ground truth):
private void createAffinityGroup(Stack stack,AzureClient azureClient,AzureTemplate azureTemplate,String name){
  try {
    azureClient.getAffinityGroup(name);
  }
 catch (  Exception ex) {
    if (((HttpResponseException)ex).getStatusCode() == NOT_FOUND) {
      Map<String,String> props=new HashMap<>();
      props.put(NAME,name);
      props.put(LOCATION,azureTemplate.getLocation().location());
      props.put(DESCRIPTION,azureTemplate.getDescription());
      HttpResponseDecorator affinityResponse=(HttpResponseDecorator)azureClient.createAffinityGroup(props);
      String requestId=(String)azureClient.getRequestId(affinityResponse);
      azureClient.waitUntilComplete(requestId);
    }
 else     if (ex instanceof HttpResponseException) {
      LOGGER.error(String.format("String_Node_Str",stack.getId()),ex);
      throw new InternalServerException(((HttpResponseException)ex).getResponse().toString());
    }
 else {
      LOGGER.error(String.format("String_Node_Str",stack.getId()),ex);
      throw new InternalServerException(ex.getMessage());
    }
  }
}
Program: 64016
Project: 64016
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  if ("String_Node_Str".equals(hbm2ddlStrategy) || "String_Node_Str".equals(hbm2ddlStrategy)) {
    Company company=new Company();
    company.setName("String_Node_Str");
    company=companyRepository.save(company);
    User user2=new User();
    user2.setEmail("String_Node_Str");
    user2.setFirstName("String_Node_Str");
    user2.setLastName("String_Node_Str");
    user2.setPassword(passwordEncoder.encode("String_Node_Str"));
    user2.setStatus(UserStatus.ACTIVE);
    user2.setCompany(company);
    user2.getUserRoles().add(UserRole.COMPANY_ADMIN);
    AwsCredential awsCredential=new AwsCredential();
    awsCredential.setRoleArn("String_Node_Str");
    awsCredential.setAwsCredentialOwner(user2);
    awsCredential.setPublicKey("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    awsCredential.setName("String_Node_Str");
    awsCredential.setKeyPairName("String_Node_Str");
    user2.getAwsCredentials().add(awsCredential);
    AwsTemplate awsTemplate=new AwsTemplate();
    awsTemplate.setName("String_Node_Str");
    awsTemplate.setDescription("String_Node_Str");
    awsTemplate.setRegion(Regions.EU_WEST_1);
    awsTemplate.setAmiId("String_Node_Str");
    awsTemplate.setInstanceType(InstanceType.T2Small);
    awsTemplate.setSshLocation("String_Node_Str");
    awsTemplate.setUser(user2);
    user2.getAwsTemplates().add(awsTemplate);
    Set<Blueprint> blueprints=defaultBlueprintLoaderService.loadBlueprints(user2);
    user2.setBlueprints(blueprints);
    userRepository.save(user2);
  }
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  if ("String_Node_Str".equals(hbm2ddlStrategy) || "String_Node_Str".equals(hbm2ddlStrategy)) {
    Company company=new Company();
    company.setName(defaultCompanyName);
    User user=new User();
    user.setEmail(defaultUserEmail);
    user.setFirstName(defaultUserFirstName);
    user.setLastName(defaultUserLastName);
    user.setPassword(passwordEncoder.encode(defaultUserPassword));
    user.setStatus(UserStatus.ACTIVE);
    user.setCompany(company);
    user.getUserRoles().add(UserRole.COMPANY_ADMIN);
    Set<Blueprint> blueprints=defaultBlueprintLoaderService.loadBlueprints(user);
    user.setBlueprints(blueprints);
    company.getUsers().add(user);
    companyRepository.save(company);
  }
}
Program: 64017
Project: 64017
Buggy source:
public Set<StackJson> convertAllEntityToJsonWithClause(Collection<Stack> entityList){
  Set<StackJson> stackJsons=new HashSet<>();
  for (  Stack stack : entityList) {
    if (Boolean.FALSE.equals(stack.getTerminated())) {
      stackJsons.add(convert(stack));
    }
  }
  return stackJsons;
}

Fixed version (ground truth):
public Set<StackJson> convertAllEntityToJsonWithClause(Collection<Stack> entityList){
  Set<StackJson> stackJsons=new HashSet<>();
  for (  Stack stack : entityList) {
    stackJsons.add(convert(stack));
  }
  return stackJsons;
}
Program: 64018
Project: 64018
Buggy source:
@Override public HistoryEvent getEventType(ProvisionEntity entity){
  HistoryEvent historyEvent=HistoryEvent.IGNORE;
  if (isEntitySupported(entity)) {
    Long id=null;
    if (entity instanceof Cluster) {
      id=((Cluster)entity).getId();
    }
 else     if (entity instanceof Blueprint) {
      id=((Blueprint)entity).getId();
    }
 else     if (entity instanceof Stack) {
      id=((Stack)entity).getId();
    }
 else     if (entity instanceof Template) {
      id=((Blueprint)entity).getId();
    }
 else     if (entity instanceof Credential) {
      id=((Credential)entity).getId();
    }
    historyEvent=(id != null) ? HistoryEvent.UPDATED : HistoryEvent.CREATED;
  }
  return historyEvent;
}

Fixed version (ground truth):
@Override public HistoryEvent getEventType(ProvisionEntity entity){
  HistoryEvent historyEvent=HistoryEvent.IGNORE;
  if (isEntitySupported(entity)) {
    Long id=null;
    if (entity instanceof Cluster) {
      id=((Cluster)entity).getId();
    }
 else     if (entity instanceof Blueprint) {
      id=((Blueprint)entity).getId();
    }
 else     if (entity instanceof Stack) {
      id=((Stack)entity).getId();
    }
 else     if (entity instanceof Template) {
      id=((Template)entity).getId();
    }
 else     if (entity instanceof Credential) {
      id=((Credential)entity).getId();
    }
    historyEvent=(id != null) ? HistoryEvent.UPDATED : HistoryEvent.CREATED;
  }
  return historyEvent;
}
Program: 64019
Project: 64019
Buggy source:
@Override public StackHistory convert(Stack entity){
  StackHistory stackHistory=new StackHistory();
  stackHistory.setName(entity.getName());
  stackHistory.setEntityId(entity.getId());
  stackHistory.setAmbariIp(entity.getAmbariIp());
  stackHistory.setClusterId(entity.getCluster().getId());
  stackHistory.setCredentialId(entity.getCredential().getId());
  stackHistory.setHash(entity.getHash());
  stackHistory.setMetadataReady(entity.isMetadataReady());
  stackHistory.setNodeCount(entity.getNodeCount());
  stackHistory.setStackCompleted(entity.isStackCompleted());
  stackHistory.setStatus(entity.getStatus().name());
  stackHistory.setStatusReason(entity.getStatusReason());
  stackHistory.setTemplateId(entity.getTemplate().getId());
  stackHistory.setTerminated(entity.getTerminated());
  stackHistory.setVersion(entity.getVersion());
  stackHistory.setDescription(entity.getDescription());
  stackHistory.setUserId(entity.getUser().getId());
  return stackHistory;
}

Fixed version (ground truth):
@Override public StackHistory convert(Stack entity){
  StackHistory stackHistory=new StackHistory();
  stackHistory.setName(entity.getName());
  stackHistory.setEntityId(entity.getId());
  stackHistory.setAmbariIp(entity.getAmbariIp());
  stackHistory.setClusterId(entity.getCluster().getId());
  stackHistory.setCredentialId(entity.getCredential().getId());
  stackHistory.setHash(entity.getHash());
  stackHistory.setMetadataReady(entity.isMetadataReady());
  stackHistory.setNodeCount(entity.getNodeCount());
  stackHistory.setStackCompleted(entity.isStackCompleted());
  stackHistory.setStatus(entity.getStatus().name());
  stackHistory.setStatusReason(entity.getStatusReason());
  stackHistory.setTemplateId(entity.getTemplate().getId());
  stackHistory.setVersion(entity.getVersion());
  stackHistory.setDescription(entity.getDescription());
  stackHistory.setUserId(entity.getUser().getId());
  return stackHistory;
}
Program: 64020
Project: 64020
Buggy source:
@Override public Set<Stack> getAll(User user){
  Set<Stack> legacyStacks=new HashSet<>();
  Set<Stack> terminatedStacks=new HashSet<>();
  Set<Stack> userStacks=user.getStacks();
  LOGGER.debug("String_Node_Str",userStacks.size());
  if (user.getUserRoles().contains(UserRole.COMPANY_ADMIN)) {
    LOGGER.debug("String_Node_Str",user.getId());
    legacyStacks=getCompanyUserStacks(user);
  }
 else {
    LOGGER.debug("String_Node_Str",user.getId());
    legacyStacks=getCompanyStacks(user);
  }
  LOGGER.debug("String_Node_Str",legacyStacks.size(),user.getId());
  userStacks.addAll(legacyStacks);
  legacyStacks.clear();
  for (  Stack stack : userStacks) {
    if (Boolean.FALSE.equals(stack.getTerminated())) {
      terminatedStacks.add(stack);
    }
  }
  return terminatedStacks;
}

Fixed version (ground truth):
@Override public Set<Stack> getAll(User user){
  Set<Stack> legacyStacks=new HashSet<>();
  Set<Stack> terminatedStacks=new HashSet<>();
  Set<Stack> userStacks=user.getStacks();
  LOGGER.debug("String_Node_Str",userStacks.size());
  if (user.getUserRoles().contains(UserRole.COMPANY_ADMIN)) {
    LOGGER.debug("String_Node_Str",user.getId());
    legacyStacks=getCompanyUserStacks(user);
  }
 else {
    LOGGER.debug("String_Node_Str",user.getId());
    legacyStacks=getCompanyStacks(user);
  }
  LOGGER.debug("String_Node_Str",legacyStacks.size(),user.getId());
  userStacks.addAll(legacyStacks);
  return userStacks;
}
Program: 64021
Project: 64021
Buggy source:
@Override public Stack get(User user,Long id){
  Stack stack=stackRepository.findOne(id);
  if (stack == null || Boolean.TRUE.equals(stack.getTerminated())) {
    throw new NotFoundException(String.format("String_Node_Str",id));
  }
  return stack;
}

Fixed version (ground truth):
@Override public Stack get(User user,Long id){
  Stack stack=stackRepository.findOne(id);
  if (stack == null) {
    throw new NotFoundException(String.format("String_Node_Str",id));
  }
  return stack;
}
Program: 64022
Project: 64022
Buggy source:
@Override public void accept(Event<StackDeleteComplete> stackDeleteComplete){
  StackDeleteComplete data=stackDeleteComplete.getData();
  LOGGER.info("String_Node_Str",ReactorConfig.DELETE_COMPLETE_EVENT,data.getStackId());
  retryingStackUpdater.updateStackStatus(data.getStackId(),Status.DELETE_COMPLETED);
  Stack oneWithLists=stackRepository.findOneWithLists(data.getStackId());
  oneWithLists.setTerminated(Boolean.TRUE);
  stackRepository.save(oneWithLists);
  websocketService.sendToTopicUser(oneWithLists.getUser().getEmail(),WebsocketEndPoint.TERMINATE,new StatusMessage(oneWithLists.getId(),oneWithLists.getName(),Status.DELETE_COMPLETED.name(),String.format("String_Node_Str")));
}

Fixed version (ground truth):
@Override public void accept(Event<StackDeleteComplete> stackDeleteComplete){
  StackDeleteComplete data=stackDeleteComplete.getData();
  LOGGER.info("String_Node_Str",ReactorConfig.DELETE_COMPLETE_EVENT,data.getStackId());
  retryingStackUpdater.updateStackStatus(data.getStackId(),Status.DELETE_COMPLETED);
  Stack oneWithLists=stackRepository.findOneWithLists(data.getStackId());
  stackRepository.delete(oneWithLists);
  websocketService.sendToTopicUser(oneWithLists.getUser().getEmail(),WebsocketEndPoint.TERMINATE,new StatusMessage(oneWithLists.getId(),oneWithLists.getName(),Status.DELETE_COMPLETED.name(),String.format("String_Node_Str")));
}
Program: 64023
Project: 64023
Buggy source:
public static Stack createStack(User user){
  Stack stack=new Stack();
  stack.setUser(user);
  stack.getUserRoles().addAll(user.getUserRoles());
  stack.setTerminated(Boolean.FALSE);
  return stack;
}

Fixed version (ground truth):
public static Stack createStack(User user){
  Stack stack=new Stack();
  stack.setUser(user);
  stack.getUserRoles().addAll(user.getUserRoles());
  return stack;
}
Program: 64024
Project: 64024
Buggy source:
@Override public Class<? extends Annotation> annotationType(){
  return this.getClass();
}

Fixed version (ground truth):
@Override public Class<? extends Annotation> annotationType(){
  return getClass();
}
Program: 64025
Project: 64025
Buggy source:
@PostAuthorize("String_Node_Str") AwsCredential findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") AwsCredential findOne(@Param("String_Node_Str") Long id);
Program: 64026
Project: 64026
Buggy source:
@PostAuthorize("String_Node_Str") AwsTemplate findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") AwsTemplate findOne(@Param("String_Node_Str") Long id);
Program: 64027
Project: 64027
Buggy source:
@PostAuthorize("String_Node_Str") AzureCredential findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") AzureCredential findOne(@Param("String_Node_Str") Long id);
Program: 64028
Project: 64028
Buggy source:
@PostAuthorize("String_Node_Str") AzureTemplate findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") AzureTemplate findOne(@Param("String_Node_Str") Long id);
Program: 64029
Project: 64029
Buggy source:
@PostAuthorize("String_Node_Str") Blueprint findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") Blueprint findOne(@Param("String_Node_Str") Long id);
Program: 64030
Project: 64030
Buggy source:
Cluster findById(Long id);

Fixed version (ground truth):
Cluster findById(@Param("String_Node_Str") Long id);
Program: 64031
Project: 64031
Buggy source:
@PostAuthorize("String_Node_Str") Cluster findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") Cluster findOne(@Param("String_Node_Str") Long id);
Program: 64032
Project: 64032
Buggy source:
@PostAuthorize("String_Node_Str") Credential findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") Credential findOne(@Param("String_Node_Str") Long id);
Program: 64033
Project: 64033
Buggy source:
Stack findById(Long id);

Fixed version (ground truth):
Stack findById(@Param("String_Node_Str") Long id);
Program: 64034
Project: 64034
Buggy source:
@PostAuthorize("String_Node_Str") Stack findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") Stack findOne(@Param("String_Node_Str") Long id);
Program: 64035
Project: 64035
Buggy source:
@PostAuthorize("String_Node_Str") Template findOne(Long id);

Fixed version (ground truth):
@PostAuthorize("String_Node_Str") Template findOne(@Param("String_Node_Str") Long id);
Program: 64036
Project: 64036
Buggy source:
User findByEmail(String email);

Fixed version (ground truth):
User findByEmail(@Param("String_Node_Str") String email);
Program: 64037
Project: 64037
Buggy source:
@Override public Set<StackJson> getAll(User user){
  Set<StackJson> result=new HashSet<>();
  for (  Stack stack : user.getStacks()) {
    CloudPlatform cp=stack.getTemplate().cloudPlatform();
    StackDescription description=provisionServices.get(cp).describeStack(user,stack,stack.getCredential());
    result.add(stackConverter.convert(stack,description));
  }
  return result;
}

Fixed version (ground truth):
@Override public Set<StackJson> getAll(User user){
  Set<StackJson> result=new HashSet<>();
  for (  Stack stack : user.getStacks()) {
    CloudPlatform cp=stack.getTemplate().cloudPlatform();
    result.add(stackConverter.convert(stack));
  }
  return result;
}
Program: 64039
Project: 64039
Buggy source:
@Override public void deleteStack(User user,Stack stack,Credential credential){
  LOGGER.info("String_Node_Str",stack.getId());
  AwsTemplate template=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  Resource resource=stack.getResourcebyType(ResourceType.CLOUDFORMATION_STACK);
  if (resource != null) {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(template.getRegion(),awsCredential);
    LOGGER.info("String_Node_Str",stack.getId(),resource.getResourceName());
    DeleteStackRequest deleteStackRequest=new DeleteStackRequest().withStackName(resource.getResourceName());
    client.deleteStack(deleteStackRequest);
  }
}

Fixed version (ground truth):
@Override public void deleteStack(User user,Stack stack,Credential credential){
  LOGGER.info("String_Node_Str",stack.getId());
  AwsTemplate template=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  Resource resource=stack.getResourceByType(ResourceType.CLOUDFORMATION_STACK);
  if (resource != null) {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(template.getRegion(),awsCredential);
    LOGGER.info("String_Node_Str",stack.getId(),resource.getResourceName());
    DeleteStackRequest deleteStackRequest=new DeleteStackRequest().withStackName(resource.getResourceName());
    client.deleteStack(deleteStackRequest);
  }
}
Program: 64041
Project: 64041
Buggy source:
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  Resource resource=stack.getResourcebyType(ResourceType.CLOUDFORMATION_STACK);
  try {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
    DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(resource.getResourceName());
    stackResult=client.describeStacks(stackRequest);
  }
 catch (  AmazonServiceException e) {
    if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",resource.getResourceName()))) {
      LOGGER.error("String_Node_Str",resource.getResourceName());
      stackResult=new DescribeStacksResult();
    }
 else {
      throw e;
    }
  }
  AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues());
  instancesResult=ec2Client.describeInstances(instancesRequest);
  return new AwsStackDescription(stackResult,instancesResult);
}

Fixed version (ground truth):
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  Resource resource=stack.getResourceByType(ResourceType.CLOUDFORMATION_STACK);
  if (resource != null) {
    try {
      AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
      DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(resource.getResourceName());
      stackResult=client.describeStacks(stackRequest);
    }
 catch (    AmazonServiceException e) {
      if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",resource.getResourceName()))) {
        LOGGER.error("String_Node_Str",resource.getResourceName());
        stackResult=new DescribeStacksResult();
      }
 else {
        throw e;
      }
    }
    AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
    DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues());
    instancesResult=ec2Client.describeInstances(instancesRequest);
  }
  return new AwsStackDescription(stackResult,instancesResult);
}
Program: 64046
Project: 64046
Buggy source:
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  String filePath=AzureCertificateService.getUserJksFileName(credential,user.emailAsFolder());
  AzureClient azureClient=azureStackUtil.createAzureClient(credential,filePath);
  AzureStackDescription azureStackDescription=new AzureStackDescription();
  for (  Resource resource : stack.getResourcesbyType(ResourceType.CLOUD_SERVICE)) {
    try {
      Object cloudService=azureClient.getCloudService(resource.getResourceName());
      azureStackDescription.getCloudServices().add(jsonHelper.createJsonFromString(cloudService.toString()).toString());
    }
 catch (    Exception ex) {
      azureStackDescription.getCloudServices().add(jsonHelper.createJsonFromString(String.format("String_Node_Str",ERROR)).toString());
    }
  }
  for (  Resource resource : stack.getResourcesbyType(ResourceType.VIRTUAL_MACHINE)) {
    Map<String,String> props=new HashMap<>();
    props.put(SERVICENAME,resource.getResourceName());
    props.put(NAME,resource.getResourceName());
    try {
      Object virtualMachine=azureClient.getVirtualMachine(props);
      azureStackDescription.getVirtualMachines().add(jsonHelper.createJsonFromString(virtualMachine.toString()).toString());
    }
 catch (    Exception ex) {
      azureStackDescription.getVirtualMachines().add(jsonHelper.createJsonFromString(String.format("String_Node_Str",ERROR)).toString());
    }
  }
  return azureStackDescription;
}

Fixed version (ground truth):
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  String filePath=AzureCertificateService.getUserJksFileName(credential,user.emailAsFolder());
  AzureClient azureClient=azureStackUtil.createAzureClient(credential,filePath);
  AzureStackDescription azureStackDescription=new AzureStackDescription();
  for (  Resource resource : stack.getResourcesByType(ResourceType.CLOUD_SERVICE)) {
    try {
      Object cloudService=azureClient.getCloudService(resource.getResourceName());
      azureStackDescription.getCloudServices().add(jsonHelper.createJsonFromString(cloudService.toString()).toString());
    }
 catch (    Exception ex) {
      azureStackDescription.getCloudServices().add(jsonHelper.createJsonFromString(String.format("String_Node_Str",ERROR)).toString());
    }
  }
  for (  Resource resource : stack.getResourcesByType(ResourceType.VIRTUAL_MACHINE)) {
    Map<String,String> props=new HashMap<>();
    props.put(SERVICENAME,resource.getResourceName());
    props.put(NAME,resource.getResourceName());
    try {
      Object virtualMachine=azureClient.getVirtualMachine(props);
      azureStackDescription.getVirtualMachines().add(jsonHelper.createJsonFromString(virtualMachine.toString()).toString());
    }
 catch (    Exception ex) {
      azureStackDescription.getVirtualMachines().add(jsonHelper.createJsonFromString(String.format("String_Node_Str",ERROR)).toString());
    }
  }
  return azureStackDescription;
}
Program: 64047
Project: 64047
Buggy source:
private synchronized void handleCfStackCreateComplete(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByCfStackId(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted()) {
    awsNetworkConfigurator.disableSourceDestCheck(stack);
    stack=stackUpdater.updateStackCreateComplete(stack.getId());
    LOGGER.info("String_Node_Str",stack.getId());
    LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
    Set<Resource> resourceSet=new HashSet<>();
    resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_STACK,cfMessage.get("String_Node_Str"),stack));
    reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AWS,stack.getId(),resourceSet)));
  }
}

Fixed version (ground truth):
private synchronized void handleCfStackCreateComplete(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByStackResourceName(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted()) {
    awsNetworkConfigurator.disableSourceDestCheck(stack);
    stack=stackUpdater.updateStackCreateComplete(stack.getId());
    LOGGER.info("String_Node_Str",stack.getId());
    LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
    Set<Resource> resourceSet=new HashSet<>();
    resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_STACK,cfMessage.get("String_Node_Str"),stack));
    reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AWS,stack.getId(),resourceSet)));
  }
}
Program: 64048
Project: 64048
Buggy source:
private synchronized void handleCfStackCreateFailed(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByCfStackId(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted() && !Status.CREATE_FAILED.equals(stack.getStatus())) {
    LOGGER.info("String_Node_Str",stack.getId());
    StackCreationFailure stackCreationFailure=new StackCreationFailure(stack.getId(),"String_Node_Str" + cfMessage.get("String_Node_Str"));
    LOGGER.info("String_Node_Str",ReactorConfig.STACK_CREATE_FAILED_EVENT,stack.getId());
    reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(stackCreationFailure));
  }
 else {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
private synchronized void handleCfStackCreateFailed(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByStackResourceName(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted() && !Status.CREATE_FAILED.equals(stack.getStatus())) {
    LOGGER.info("String_Node_Str",stack.getId());
    StackCreationFailure stackCreationFailure=new StackCreationFailure(stack.getId(),"String_Node_Str" + cfMessage.get("String_Node_Str"));
    LOGGER.info("String_Node_Str",ReactorConfig.STACK_CREATE_FAILED_EVENT,stack.getId());
    reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(stackCreationFailure));
  }
 else {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
}
Program: 64049
Project: 64049
Buggy source:
public void setupMetadata(CloudPlatform cloudPlatform,Long stackId){
  try {
    Stack stack=stackRepository.findById(stackId);
    MetadataSetup metadataSetup=metadataSetups.get(cloudPlatform);
    metadataSetup.setupMetadata(stack);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    LOGGER.info("String_Node_Str",ReactorConfig.STACK_CREATE_FAILED_EVENT,stackId);
    StackCreationFailure stackCreationFailure=new StackCreationFailure(stackId,"String_Node_Str");
    reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(stackCreationFailure));
  }
}

Fixed version (ground truth):
public void setupMetadata(CloudPlatform cloudPlatform,Long stackId){
  try {
    Stack stack=stackRepository.findOneWithLists(stackId);
    MetadataSetup metadataSetup=metadataSetups.get(cloudPlatform);
    metadataSetup.setupMetadata(stack);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    LOGGER.info("String_Node_Str",ReactorConfig.STACK_CREATE_FAILED_EVENT,stackId);
    StackCreationFailure stackCreationFailure=new StackCreationFailure(stackId,"String_Node_Str");
    reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(stackCreationFailure));
  }
}
Program: 64050
Project: 64050
Buggy source:
@Test public void testHandleMessageWhenStackNotFoundShouldStackCreationFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByCfStackId(anyString())).willReturn(null);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testHandleMessageWhenStackNotFoundShouldStackCreationFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByStackResourceName(anyString())).willReturn(null);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64051
Project: 64051
Buggy source:
@Test public void testHandleMessageCreationComplete(){
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(createCFMessage());
  given(stackRepository.findByCfStackId(anyString())).willReturn(stack);
  given(stackUpdater.updateStackCreateComplete(anyLong())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testHandleMessageCreationComplete(){
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(createCFMessage());
  given(stackRepository.findByStackResourceName(anyString())).willReturn(stack);
  given(stackUpdater.updateStackCreateComplete(anyLong())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}