Program: 166436
Project: 166436
Buggy source:
public List<String> getQueueList(final String queueNameMatching,final List<String> existingQueueList){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + queueNameMatching);
  }
  final String errMsg=errMessage;
  List<String> ret=new ArrayList<String>();
  Callable<List<String>> yarnQueueListGetter=new Callable<List<String>>(){
    @Override public List<String> call(){
      List<String> lret=new ArrayList<String>();
      String url=yarnQUrl + YARN_LIST_API_ENDPOINT;
      Client client=null;
      ClientResponse response=null;
      try {
        client=Client.create();
        WebResource webResource=client.resource(url);
        response=webResource.accept(EXPECTED_MIME_TYPE).get(ClientResponse.class);
        if (LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str" + url);
        }
        if (response != null) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str" + response.getStatus());
          }
          if (response.getStatus() == 200) {
            String jsonString=response.getEntity(String.class);
            Gson gson=new GsonBuilder().setPrettyPrinting().create();
            YarnSchedulerResponse yarnQResponse=gson.fromJson(jsonString,YarnSchedulerResponse.class);
            if (yarnQResponse != null) {
              List<String> yarnQueueList=yarnQResponse.getQueueNames();
              if (yarnQueueList != null) {
                for (                String yarnQueueName : yarnQueueList) {
                  if (existingQueueList != null && existingQueueList.contains(yarnQueueName)) {
                    continue;
                  }
                  if (queueNameMatching == null || queueNameMatching.isEmpty() || yarnQueueName.startsWith(queueNameMatching)) {
                    if (LOG.isDebugEnabled()) {
                      LOG.debug("String_Node_Str" + yarnQueueName);
                    }
                    lret.add(yarnQueueName);
                  }
                }
              }
            }
          }
 else {
            LOG.info("String_Node_Str" + response.getStatus() + "String_Node_Str"+ url+ "String_Node_Str");
            String jsonString=response.getEntity(String.class);
            LOG.info(jsonString);
            lret=null;
          }
        }
 else {
          lret=null;
          String msgDesc="String_Node_Str" + "String_Node_Str" + EXPECTED_MIME_TYPE + "String_Node_Str"+ url+ "String_Node_Str";
          LOG.error(msgDesc);
          HadoopException hdpException=new HadoopException(msgDesc);
          hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
          throw hdpException;
        }
      }
 catch (      HadoopException he) {
        lret=null;
        throw he;
      }
catch (      Throwable t) {
        lret=null;
        String msgDesc="String_Node_Str" + "String_Node_Str" + url;
        HadoopException hdpException=new HadoopException(msgDesc,t);
        LOG.error(msgDesc,t);
        hdpException.generateResponseDataMap(false,BaseClient.getMessage(t),msgDesc + errMsg,null,null);
        throw hdpException;
      }
 finally {
        if (response != null) {
          response.close();
        }
        if (client != null) {
          client.destroy();
        }
      }
      return lret;
    }
  }
;
  try {
    ret=timedTask(yarnQueueListGetter,5,TimeUnit.SECONDS);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str" + yarnQUrl + "String_Node_Str",t);
    String msgDesc="String_Node_Str" + "String_Node_Str" + EXPECTED_MIME_TYPE + "String_Node_Str"+ yarnQUrl;
    HadoopException hdpException=new HadoopException(msgDesc,t);
    LOG.error(msgDesc,t);
    hdpException.generateResponseDataMap(false,BaseClient.getMessage(t),msgDesc + errMsg,null,null);
    throw hdpException;
  }
  return ret;
}

Fixed version (ground truth):
public List<String> getQueueList(final String queueNameMatching,final List<String> existingQueueList){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + queueNameMatching);
  }
  final String errMsg=errMessage;
  List<String> ret=null;
  Callable<List<String>> yarnQueueListGetter=new Callable<List<String>>(){
    @Override public List<String> call(){
      List<String> lret=new ArrayList<String>();
      String url=yarnQUrl + YARN_LIST_API_ENDPOINT;
      Client client=null;
      ClientResponse response=null;
      try {
        client=Client.create();
        WebResource webResource=client.resource(url);
        response=webResource.accept(EXPECTED_MIME_TYPE).get(ClientResponse.class);
        if (LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str" + url);
        }
        if (response != null) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str" + response.getStatus());
          }
          if (response.getStatus() == 200) {
            String jsonString=response.getEntity(String.class);
            Gson gson=new GsonBuilder().setPrettyPrinting().create();
            YarnSchedulerResponse yarnQResponse=gson.fromJson(jsonString,YarnSchedulerResponse.class);
            if (yarnQResponse != null) {
              List<String> yarnQueueList=yarnQResponse.getQueueNames();
              if (yarnQueueList != null) {
                for (                String yarnQueueName : yarnQueueList) {
                  if (existingQueueList != null && existingQueueList.contains(yarnQueueName)) {
                    continue;
                  }
                  if (queueNameMatching == null || queueNameMatching.isEmpty() || yarnQueueName.startsWith(queueNameMatching)) {
                    if (LOG.isDebugEnabled()) {
                      LOG.debug("String_Node_Str" + yarnQueueName);
                    }
                    lret.add(yarnQueueName);
                  }
                }
              }
            }
          }
 else {
            LOG.info("String_Node_Str" + response.getStatus() + "String_Node_Str"+ url+ "String_Node_Str");
            String jsonString=response.getEntity(String.class);
            LOG.info(jsonString);
            lret=null;
          }
        }
 else {
          lret=null;
          String msgDesc="String_Node_Str" + "String_Node_Str" + EXPECTED_MIME_TYPE + "String_Node_Str"+ url+ "String_Node_Str";
          LOG.error(msgDesc);
          HadoopException hdpException=new HadoopException(msgDesc);
          hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
          throw hdpException;
        }
      }
 catch (      HadoopException he) {
        lret=null;
        throw he;
      }
catch (      Throwable t) {
        lret=null;
        String msgDesc="String_Node_Str" + "String_Node_Str" + url;
        HadoopException hdpException=new HadoopException(msgDesc,t);
        LOG.error(msgDesc,t);
        hdpException.generateResponseDataMap(false,BaseClient.getMessage(t),msgDesc + errMsg,null,null);
        throw hdpException;
      }
 finally {
        if (response != null) {
          response.close();
        }
        if (client != null) {
          client.destroy();
        }
      }
      return lret;
    }
  }
;
  try {
    ret=timedTask(yarnQueueListGetter,5,TimeUnit.SECONDS);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str" + yarnQUrl + "String_Node_Str",t);
    String msgDesc="String_Node_Str" + "String_Node_Str" + EXPECTED_MIME_TYPE + "String_Node_Str"+ yarnQUrl;
    HadoopException hdpException=new HadoopException(msgDesc,t);
    LOG.error(msgDesc,t);
    hdpException.generateResponseDataMap(false,BaseClient.getMessage(t),msgDesc + errMsg,null,null);
    throw hdpException;
  }
  return ret;
}