Program: 125760
Project: 125760
Buggy source:
private void initHBaseSettings(){
  DatabaseConnection connection=getConnection();
  String hadoopDistribution=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
  String hadoopVersion=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
  IHDistribution hBaseDistribution=getHBaseDistribution(hadoopDistribution,false);
  if (hBaseDistribution != null) {
    String distributionDisplayName=hBaseDistribution.getDisplayName();
    hbaseDistributionCombo.setText(distributionDisplayName);
    updateHBaseVersionPart(hBaseDistribution);
    IHDistributionVersion hdVersion=hBaseDistribution.getHDVersion(hadoopVersion,false);
    if (hdVersion != null && hdVersion.getDisplayVersion() != null) {
      hbaseVersionCombo.setText(hdVersion.getDisplayVersion());
    }
 else {
      hbaseVersionCombo.select(0);
    }
  }
 else {
    hbaseDistributionCombo.select(0);
    hbaseVersionCombo.select(0);
  }
  String useKrbString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USE_KRB);
  String useKeytabString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB);
  String keytabPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL);
  String keytab=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB);
  String masterPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL);
  String regionServerPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL);
  boolean useKrb=Boolean.valueOf(useKrbString);
  boolean useKeytab=Boolean.valueOf(useKeytabString);
  useKerberosForHBase.setSelection(useKrb);
  if (useKrb) {
    useKeyTabForHBase.setSelection(useKeytab);
    if (useKeytab) {
      principalForHBaseTxt.setText(StringUtils.trimToEmpty(keytabPrincipal));
      keytabForHBaseTxt.setText(StringUtils.trimToEmpty(keytab));
    }
    hbaseMasterPrincipalTxt.setText(StringUtils.trimToEmpty(masterPrincipal));
    hbaseRSPrincipalTxt.setText(StringUtils.trimToEmpty(regionServerPrincipal));
  }
  hideControl(keyTabCompoisteForHBase,!useKeytab);
  hideControl(authenticationComForHBase,!useKrb);
  hideControl(authenticationGrpForHBase,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && hBaseDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(hBaseDistribution.getHDVersion(hadoopVersion,false));
  }
  String useMaprTForHBaseString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_USE_MAPRTICKET);
  String maprTUsernameForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_USERNAME);
  String maprTPasswordForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_PASSWORD);
  String maprTClusterForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_CLUSTER);
  String maprTDurationForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_DURATION);
  boolean checkMaprTForHBase=Boolean.valueOf(useMaprTForHBaseString);
  useMaprTForHBase.setEnabled(doSupportMapRTicket);
  useMaprTForHBase.setSelection(checkMaprTForHBase);
  if (checkMaprTForHBase) {
    maprTUsernameForHBaseTxt.setText(StringUtils.trimToEmpty(maprTUsernameForHBase));
    maprTPasswordForHBaseTxt.setText(StringUtils.trimToEmpty(maprTPasswordForHBase));
    maprTClusterForHBaseTxt.setText(StringUtils.trimToEmpty(maprTClusterForHBase));
    maprTDurationForHBaseTxt.setText(maprTDurationForHBase == null ? "String_Node_Str" : maprTDurationForHBase.trim());
  }
  hideControl(authenticationMaprTComForHBase,!checkMaprTForHBase);
  hideControl(authenticationUserPassComForHBase,useKrb);
}

Fixed version (ground truth):
private void initHBaseSettings(){
  DatabaseConnection connection=getConnection();
  String hadoopDistribution=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
  String hadoopVersion=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
  IHDistribution hBaseDistribution=getHBaseDistribution(hadoopDistribution,false);
  if (hBaseDistribution != null) {
    String distributionDisplayName=hBaseDistribution.getDisplayName();
    hbaseDistributionCombo.setText(distributionDisplayName);
    updateHBaseVersionPart(hBaseDistribution);
    IHDistributionVersion hdVersion=hBaseDistribution.getHDVersion(hadoopVersion,false);
    if (hdVersion != null && hdVersion.getDisplayVersion() != null) {
      hbaseVersionCombo.setText(hdVersion.getDisplayVersion());
    }
 else {
      hbaseVersionCombo.select(0);
    }
  }
 else {
    hbaseDistributionCombo.select(0);
    hbaseVersionCombo.select(0);
  }
  String useKrbString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USE_KRB);
  String useKeytabString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB);
  String keytabPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL);
  String keytab=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB);
  String masterPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL);
  String regionServerPrincipal=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL);
  boolean useKrb=Boolean.valueOf(useKrbString);
  boolean useKeytab=Boolean.valueOf(useKeytabString);
  useKerberosForHBase.setSelection(useKrb);
  if (useKrb) {
    useKeyTabForHBase.setSelection(useKeytab);
    if (useKeytab) {
      principalForHBaseTxt.setText(StringUtils.trimToEmpty(keytabPrincipal));
      keytabForHBaseTxt.setText(StringUtils.trimToEmpty(keytab));
    }
    hbaseMasterPrincipalTxt.setText(StringUtils.trimToEmpty(masterPrincipal));
    hbaseRSPrincipalTxt.setText(StringUtils.trimToEmpty(regionServerPrincipal));
  }
  hideControl(keyTabCompoisteForHBase,!useKeytab);
  hideControl(authenticationComForHBase,!useKrb);
  hideControl(authenticationGrpForHBase,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && hBaseDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(hBaseDistribution.getHDVersion(hadoopVersion,false));
  }
  String useMaprTForHBaseString=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_USE_MAPRTICKET);
  String maprTUsernameForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_USERNAME);
  String maprTPasswordForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_PASSWORD);
  String maprTClusterForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_CLUSTER);
  String maprTDurationForHBase=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_DURATION);
  boolean checkMaprTForHBase=Boolean.valueOf(useMaprTForHBaseString);
  useMaprTForHBase.setSelection(checkMaprTForHBase);
  if (checkMaprTForHBase) {
    maprTUsernameForHBaseTxt.setText(StringUtils.trimToEmpty(maprTUsernameForHBase));
    maprTPasswordForHBaseTxt.setText(StringUtils.trimToEmpty(maprTPasswordForHBase));
    maprTClusterForHBaseTxt.setText(StringUtils.trimToEmpty(maprTClusterForHBase));
    maprTDurationForHBaseTxt.setText(maprTDurationForHBase == null ? "String_Node_Str" : maprTDurationForHBase.trim());
  }
  hideControl(useMaprTForHBase,!doSupportMapRTicket);
  hideControl(authenticationMaprTComForHBase,!(checkMaprTForHBase && doSupportMapRTicket));
  hideControl(authenticationUserPassComForHBase,useKrb && doSupportMapRTicket);
  authenticationGrpForHBase.layout();
  authenticationGrpForHBase.getParent().layout();
}