Program: 124802
Project: 124802
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 getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getHostName()));
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_PORT.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getPort()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHCatalogRepositoryToComponent.KRB_PRINC.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KRB_REALM.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getKrbRealm()));
  }
 else   if (EHCatalogRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHCatalogRepositoryToComponent.DATABASE_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getDatabase()));
  }
 else   if (EHCatalogRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHCatalogRepositoryToComponent.ROWSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getRowSeparator()));
  }
 else   if (EHCatalogRepositoryToComponent.FIELDSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 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 getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHCatalogRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHCatalogRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,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)) {
    return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection,connection.getHadoopProperties(),true);
  }
  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 getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getHostName()));
  }
 else   if (EHCatalogRepositoryToComponent.TEMPLETON_PORT.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getPort()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHCatalogRepositoryToComponent.KRB_PRINC.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getKrbPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KRB_REALM.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getKrbRealm()));
  }
 else   if (EHCatalogRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHCatalogRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHCatalogRepositoryToComponent.DATABASE_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getDatabase()));
  }
 else   if (EHCatalogRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHCatalogRepositoryToComponent.ROWSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getRowSeparator()));
  }
 else   if (EHCatalogRepositoryToComponent.FIELDSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 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 getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHCatalogRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHCatalogRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,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)) {
    return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection,connection.getHadoopProperties(),true);
  }
 else   if (EHDFSRepositoryToComponent.USE_CLOUDERA_NAVIGATOR.getRepositoryValue().equals(value)) {
    return hcConnection.isUseClouderaNavi();
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_USERNAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,HadoopRepositoryUtil.getClouderaNaviUserName(connection));
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_PASSWORD.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,HadoopRepositoryUtil.getClouderaNaviPassword(connection));
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_URL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,HadoopRepositoryUtil.getClouderaNaviUrl(connection));
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_METADATA_URL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,HadoopRepositoryUtil.getClouderaNaviMetadataUrl(connection));
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_CLIENT_URL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,HadoopRepositoryUtil.getClouderaNaviClientUrl(connection));
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_AUTOCOMMIT.getRepositoryValue().equals(value)) {
    return HadoopRepositoryUtil.clouderaNaviAutoCommit(connection);
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_DISABLE_SSL_VALIDATION.getRepositoryValue().equals(value)) {
    return HadoopRepositoryUtil.clouderaNaviDisableSSL(connection);
  }
 else   if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_DIE_ON_ERROR.getRepositoryValue().equals(value)) {
    return HadoopRepositoryUtil.clouderaNaviDieOnError(connection);
  }
  return null;
}