Program: 124803
Project: 124803
Buggy source:
private Object getHDFSRepositoryValue(HDFSConnection connection,String value,IMetadataTable table,String targetComponent){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection == null) {
    return null;
  }
  if (EHDFSRepositoryToComponent.DISTRIBUTION.getRepositoryValue().equals(value)) {
    return hcConnection.getDistribution();
  }
 else   if (EHDFSRepositoryToComponent.DB_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHDFSRepositoryToComponent.HADOOP_CUSTOM_JARS.getRepositoryValue().equals(value)) {
    if (targetComponent != null && targetComponent.startsWith("String_Node_Str")) {
      return hcConnection.getParameters().get(ECustomVersionGroup.PIG.getName());
    }
    return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection,ECustomVersionGroup.COMMON);
  }
 else   if (EHDFSRepositoryToComponent.USE_YARN.getRepositoryValue().equals(value)) {
    return hcConnection.isUseYarn();
  }
 else   if (EHDFSRepositoryToComponent.AUTHENTICATION_MODE.getRepositoryValue().equals(value)) {
    return hcConnection.getAuthMode();
  }
 else   if (EHDFSRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHDFSRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHDFSRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.RESOURCEMANAGER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJtOrRmPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.JOBHISTORY_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobHistoryPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHDFSRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHDFSRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHDFSRepositoryToComponent.GROUP.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getGroup()));
  }
 else   if (EHDFSRepositoryToComponent.ROWSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getRowSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.FIELDSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.HEADER.getRepositoryValue().equals(value)) {
    return StringUtils.trimToNull(connection.getHeaderValue());
  }
 else   if (EHDFSRepositoryToComponent.LOCAL.getRepositoryValue().equals(value)) {
    return false;
  }
 else   if (EHDFSRepositoryToComponent.MAPREDUCE.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.PIG_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHDFSRepositoryToComponent.MAPRED_JOB_TRACKER.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.MAPRED_RESOURCE_MANAGER.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.RESOURCE_MANAGER.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHDFSRepositoryToComponent.FIELD_SEPARATOR_CHAR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.LOAD.getRepositoryValue().equals(value)) {
    return "String_Node_Str";
  }
 else   if (EHDFSRepositoryToComponent.HADOOP_ADVANCED_PROPERTIES.getRepositoryValue().equals(value)) {
    return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection,connection.getHadoopProperties(),true);
  }
 else   if (EHDFSRepositoryToComponent.SET_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.RESOURCEMANAGER_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getRmScheduler()));
  }
 else   if (EHDFSRepositoryToComponent.SET_JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobHistory()));
  }
 else   if (EHDFSRepositoryToComponent.SET_STAGING_DIRECTORY.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.STAGING_DIRECTORY.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getStagingDirectory()));
  }
 else   if (EHDFSRepositoryToComponent.USE_DATANODE_HOSTNAME.getRepositoryValue().equals(value)) {
    return hcConnection.isUseDNHost();
  }
  return null;
}

Fixed version (ground truth):
private Object getHDFSRepositoryValue(HDFSConnection connection,String value,IMetadataTable table,String targetComponent){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection == null) {
    return null;
  }
  if (EHDFSRepositoryToComponent.DISTRIBUTION.getRepositoryValue().equals(value)) {
    return hcConnection.getDistribution();
  }
 else   if (EHDFSRepositoryToComponent.DB_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHDFSRepositoryToComponent.HADOOP_CUSTOM_JARS.getRepositoryValue().equals(value)) {
    if (targetComponent != null && targetComponent.startsWith("String_Node_Str")) {
      return hcConnection.getParameters().get(ECustomVersionGroup.PIG.getName());
    }
    return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection,ECustomVersionGroup.COMMON);
  }
 else   if (EHDFSRepositoryToComponent.USE_YARN.getRepositoryValue().equals(value)) {
    return hcConnection.isUseYarn();
  }
 else   if (EHDFSRepositoryToComponent.AUTHENTICATION_MODE.getRepositoryValue().equals(value)) {
    return hcConnection.getAuthMode();
  }
 else   if (EHDFSRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getNameNodeURI()));
  }
 else   if (EHDFSRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {
    return hcConnection.isEnableKerberos();
  }
 else   if (EHDFSRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.RESOURCEMANAGER_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJtOrRmPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.JOBHISTORY_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobHistoryPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {
    return hcConnection.isUseKeytab();
  }
 else   if (EHDFSRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));
  }
 else   if (EHDFSRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getKeytab()));
  }
 else   if (EHDFSRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getUserName()));
  }
 else   if (EHDFSRepositoryToComponent.GROUP.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getGroup()));
  }
 else   if (EHDFSRepositoryToComponent.ROWSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getRowSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.FIELDSEPARATOR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.HEADER.getRepositoryValue().equals(value)) {
    return StringUtils.trimToNull(connection.getHeaderValue());
  }
 else   if (EHDFSRepositoryToComponent.LOCAL.getRepositoryValue().equals(value)) {
    return false;
  }
 else   if (EHDFSRepositoryToComponent.MAPREDUCE.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.PIG_VERSION.getRepositoryValue().equals(value)) {
    return hcConnection.getDfVersion();
  }
 else   if (EHDFSRepositoryToComponent.MAPRED_JOB_TRACKER.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.MAPRED_RESOURCE_MANAGER.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.RESOURCE_MANAGER.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobTrackerURI()));
  }
 else   if (EHDFSRepositoryToComponent.FIELD_SEPARATOR_CHAR.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(connection.getFieldSeparator()));
  }
 else   if (EHDFSRepositoryToComponent.LOAD.getRepositoryValue().equals(value)) {
    return "String_Node_Str";
  }
 else   if (EHDFSRepositoryToComponent.HADOOP_ADVANCED_PROPERTIES.getRepositoryValue().equals(value)) {
    return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection,connection.getHadoopProperties(),true);
  }
 else   if (EHDFSRepositoryToComponent.SET_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.RESOURCEMANAGER_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getRmScheduler()));
  }
 else   if (EHDFSRepositoryToComponent.SET_JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getJobHistory()));
  }
 else   if (EHDFSRepositoryToComponent.SET_STAGING_DIRECTORY.getRepositoryValue().equals(value)) {
    return true;
  }
 else   if (EHDFSRepositoryToComponent.STAGING_DIRECTORY.getRepositoryValue().equals(value)) {
    return getRepositoryValueOfStringType(hcConnection,StringUtils.trimToNull(hcConnection.getStagingDirectory()));
  }
 else   if (EHDFSRepositoryToComponent.USE_DATANODE_HOSTNAME.getRepositoryValue().equals(value)) {
    return hcConnection.isUseDNHost();
  }
 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;
}