Program: 125014
Project: 125014
Buggy source:
private Object getHCatalogRepositoryValue(HCatalogConnection connection,String value,IMetadataTable table,String targetComponent){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection == null) {
    return null;
  }
  if (EHCatalogRepositoryToComponent.DISTRIBUTION.getRepositoryValue().equals(value)) {
    return hcConnection.getDistribution();
  }
 else   if (EHCatalogRepositoryToComponent.HCAT_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_HOST.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getHostName()));
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_PORT.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getPort()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHCatalogRepositoryToComponent.KRB_PRINC.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KRB_REALM.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbRealm()));
  }
 else   if (EHCatalogRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHCatalogRepositoryToComponent.DATABASE_NAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getDatabase()));
  }
 else   if (EHCatalogRepositoryToComponent.TABLE_NAME.getRepositoryValue().equals(value)) {
  }
 else   if (EHCatalogRepositoryToComponent.PARTITION_NAME.getRepositoryValue().equals(value)) {
  }
 else   if (EHCatalogRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHCatalogRepositoryToComponent.LOCAL.getRepositoryValue().equals(value)) {
    return false;
  }
 else   if (EHCatalogRepositoryToComponent.MAPREDUCE.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHCatalogRepositoryToComponent.PIG_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHCatalogRepositoryToComponent.MAPRED_JOB_TRACKER.getRepositoryValue().equals(value) || EHCatalogRepositoryToComponent.MAPRED_RESOURCE_MANAGER.getRepositoryValue().equals(value) || EHCatalogRepositoryToComponent.RESOURCE_MANAGER.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHCatalogRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHCatalogRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.LOAD.getRepositoryValue().equals(value)) {
    return HCATALOG_LOAD;
  }
 else   if (EHCatalogRepositoryToComponent.STORE.getRepositoryValue().equals(value)) {
    return HCATALOG_STORE;
  }
 else   if (EHCatalogRepositoryToComponent.HADOOP_CUSTOM_JARS.getRepositoryValue().equals(value)) {
    if (targetComponent != null && targetComponent.startsWith("String_Node_Str")) {
      return hcConnection.getParameters().get(ECustomVersionGroup.PIG_HCATALOG.getName());
    }
  }
 else   if (EHCatalogRepositoryToComponent.HADOOP_ADVANCED_PROPERTIES.getRepositoryValue().equals(value)) {
    try {
      return HadoopRepositoryUtil.getHadoopPropertiesList(connection.getHadoopProperties(),true);
    }
 catch (    JSONException e) {
      ExceptionHandler.process(e);
    }
  }
  return null;
}

Fixed version (ground truth):
private Object getHCatalogRepositoryValue(HCatalogConnection connection,String value,IMetadataTable table,String targetComponent){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection == null) {
    return null;
  }
  if (EHCatalogRepositoryToComponent.DISTRIBUTION.getRepositoryValue().equals(value)) {
    return hcConnection.getDistribution();
  }
 else   if (EHCatalogRepositoryToComponent.HCAT_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_HOST.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getHostName()));
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_PORT.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getPort()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHCatalogRepositoryToComponent.KRB_PRINC.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KRB_REALM.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbRealm()));
  }
 else   if (EHCatalogRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHCatalogRepositoryToComponent.DATABASE_NAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getDatabase()));
  }
 else   if (EHCatalogRepositoryToComponent.TABLE_NAME.getRepositoryValue().equals(value)) {
  }
 else   if (EHCatalogRepositoryToComponent.PARTITION_NAME.getRepositoryValue().equals(value)) {
  }
 else   if (EHCatalogRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHCatalogRepositoryToComponent.LOCAL.getRepositoryValue().equals(value)) {
    return false;
  }
 else   if (EHCatalogRepositoryToComponent.MAPREDUCE.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHCatalogRepositoryToComponent.PIG_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHCatalogRepositoryToComponent.MAPRED_JOB_TRACKER.getRepositoryValue().equals(value) || EHCatalogRepositoryToComponent.MAPRED_RESOURCE_MANAGER.getRepositoryValue().equals(value) || EHCatalogRepositoryToComponent.RESOURCE_MANAGER.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHCatalogRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHCatalogRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.LOAD.getRepositoryValue().equals(value)) {
    return HCATALOG_LOAD;
  }
 else   if (EHCatalogRepositoryToComponent.STORE.getRepositoryValue().equals(value)) {
    return HCATALOG_STORE;
  }
 else   if (EHCatalogRepositoryToComponent.HADOOP_CUSTOM_JARS.getRepositoryValue().equals(value)) {
    if (targetComponent != null && targetComponent.startsWith("String_Node_Str")) {
      return hcConnection.getParameters().get(ECustomVersionGroup.PIG_HCATALOG.getName());
    }
    return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection,ECustomVersionGroup.COMMON);
  }
 else   if (EHCatalogRepositoryToComponent.HADOOP_ADVANCED_PROPERTIES.getRepositoryValue().equals(value)) {
    try {
      return HadoopRepositoryUtil.getHadoopPropertiesList(connection.getHadoopProperties(),true);
    }
 catch (    JSONException e) {
      ExceptionHandler.process(e);
    }
  }
  return null;
}