Program: 149352
Project: 149352
Buggy source:
static void deleteInstances(List<PullRequestData> pullRequestDataList,GHPullRequest pullRequest){
  Set<PullRequestInstance> prInstances=new HashSet<PullRequestInstance>();
  for (  PullRequestData prData : pullRequestDataList) {
    prInstances.addAll(prData.getInstances());
  }
  List<String> terminatingInstanceURLs=new ArrayList<String>();
  for (  PullRequestInstance instance : prInstances) {
    Client client=ClientCache.getClient(instance.cloud);
    if (client != null) {
      IProgressMonitor monitor=null;
      try {
        LOGGER.info(MessageFormat.format("String_Node_Str",client.getInstanceUrl(instance.id),pullRequest.getUrl()));
        monitor=client.terminate(instance.id);
      }
 catch (      ClientException ex) {
        if (ex.getStatusCode() == HttpStatus.SC_CONFLICT) {
          try {
            monitor=client.forceTerminate(instance.id);
          }
 catch (          IOException ex1) {
            LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex1);
          }
        }
 else         if (ex.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
          LOGGER.info(MessageFormat.format("String_Node_Str",client.getInstanceUrl(instance.id)));
        }
 else {
          LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex);
        }
      }
catch (      IOException ex) {
        LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex);
      }
      if (monitor != null) {
        Jenkins.getInstance().getExtensionList(ElasticBoxExecutor.Workload.class).get(DeleteInstancesWorkload.class).add(instance);
        terminatingInstanceURLs.add(monitor.getResourceUrl());
      }
    }
  }
  if (!terminatingInstanceURLs.isEmpty()) {
    try {
      pullRequest.comment(MessageFormat.format("String_Node_Str",StringUtils.join(terminatingInstanceURLs,"String_Node_Str")));
    }
 catch (    IOException ex) {
      LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",pullRequest.getUrl(),ex));
    }
  }
}

Fixed version (ground truth):
static void deleteInstances(List<PullRequestData> pullRequestDataList,GHPullRequest pullRequest){
  Set<PullRequestInstance> prInstances=new HashSet<PullRequestInstance>();
  for (  PullRequestData prData : pullRequestDataList) {
    prInstances.addAll(prData.getInstances());
  }
  List<String> terminatingInstanceURLs=new ArrayList<String>();
  for (  PullRequestInstance instance : prInstances) {
    Client client=ClientCache.getClient(instance.cloud);
    if (client != null) {
      boolean instanceExists=true;
      try {
        LOGGER.info(MessageFormat.format("String_Node_Str",client.getInstanceUrl(instance.id),pullRequest.getUrl()));
        client.terminate(instance.id);
      }
 catch (      ClientException ex) {
        if (ex.getStatusCode() == HttpStatus.SC_CONFLICT) {
          try {
            client.forceTerminate(instance.id);
          }
 catch (          IOException ex1) {
            LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex1);
          }
        }
 else         if (ex.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
          LOGGER.info(MessageFormat.format("String_Node_Str",client.getInstanceUrl(instance.id)));
          instanceExists=false;
        }
 else {
          LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex);
        }
      }
catch (      IOException ex) {
        LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",instance.id),ex);
      }
      if (instanceExists) {
        Jenkins.getInstance().getExtensionList(ElasticBoxExecutor.Workload.class).get(DeleteInstancesWorkload.class).add(instance);
        terminatingInstanceURLs.add(client.getInstanceUrl(instance.id));
      }
    }
  }
  if (!terminatingInstanceURLs.isEmpty()) {
    try {
      pullRequest.comment(MessageFormat.format("String_Node_Str",StringUtils.join(terminatingInstanceURLs,"String_Node_Str")));
    }
 catch (    IOException ex) {
      LOGGER.log(Level.SEVERE,MessageFormat.format("String_Node_Str",pullRequest.getUrl(),ex));
    }
  }
}