Program: 166479
Project: 166479
Buggy source:
public static List<String> getKnoxResources(final KnoxClient knoxClient,String topologyName,String serviceName){
  List<String> resultList=new ArrayList<String>();
  String errMsg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  try {
    if (knoxClient == null) {
      String msgDesc="String_Node_Str";
      LOG.error(msgDesc);
      HadoopException hdpException=new HadoopException(msgDesc);
      hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
      throw hdpException;
    }
    final Callable<List<String>> callableObj;
    if (serviceName != null) {
      final String finalServiceNameMatching=serviceName.trim();
      final String finalTopologyName=topologyName;
      callableObj=new Callable<List<String>>(){
        @Override public List<String> call(){
          return knoxClient.getServiceList(finalTopologyName,finalServiceNameMatching);
        }
      }
;
    }
 else {
      final String finalTopologyNameMatching=(topologyName == null) ? "String_Node_Str" : topologyName.trim();
      callableObj=new Callable<List<String>>(){
        @Override public List<String> call(){
          return knoxClient.getTopologyList(finalTopologyNameMatching);
        }
      }
;
    }
    resultList=timedTask(callableObj,5,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc,e);
    HadoopException hdpException=new HadoopException(msgDesc);
    if (!(e instanceof HadoopException)) {
      hdpException.generateResponseDataMap(false,BaseClient.getMessage(e),msgDesc + errMsg,null,null);
    }
    throw hdpException;
  }
  return resultList;
}

Fixed version (ground truth):
public static List<String> getKnoxResources(final KnoxClient knoxClient,String topologyName,String serviceName){
  List<String> resultList=new ArrayList<String>();
  String errMsg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  try {
    if (knoxClient == null) {
      String msgDesc="String_Node_Str";
      LOG.error(msgDesc);
      HadoopException hdpException=new HadoopException(msgDesc);
      hdpException.generateResponseDataMap(false,msgDesc,msgDesc + errMsg,null,null);
      throw hdpException;
    }
    final Callable<List<String>> callableObj;
    if (serviceName != null) {
      final String finalServiceNameMatching=serviceName.trim();
      final String finalTopologyName=topologyName;
      callableObj=new Callable<List<String>>(){
        @Override public List<String> call(){
          return knoxClient.getServiceList(finalTopologyName,finalServiceNameMatching);
        }
      }
;
    }
 else {
      final String finalTopologyNameMatching=(topologyName == null) ? "String_Node_Str" : topologyName.trim();
      callableObj=new Callable<List<String>>(){
        @Override public List<String> call(){
          return knoxClient.getTopologyList(finalTopologyNameMatching);
        }
      }
;
    }
    resultList=timedTask(callableObj,5,TimeUnit.SECONDS);
  }
 catch (  HadoopException he) {
    throw he;
  }
catch (  Exception e) {
    String msgDesc="String_Node_Str";
    LOG.error(msgDesc,e);
    HadoopException hdpException=new HadoopException(msgDesc);
    hdpException.generateResponseDataMap(false,BaseClient.getMessage(e),msgDesc + errMsg,null,null);
    throw hdpException;
  }
  return resultList;
}