Program: 125778
Project: 125778
Buggy source:
private void addHBaseSettingFieldsListeners(){
  hbaseDistributionCombo.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (isContextMode()) {
        return;
      }
      IHDistribution newDistribution=getHBaseDistribution(hbaseDistributionCombo.getText(),true);
      if (newDistribution == null) {
        return;
      }
      String originalDistributionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
      IHDistribution originalDistribution=getHBaseDistribution(originalDistributionName,false);
      boolean doSupportMapRTicket=false;
      IHadoopDistributionService hadoopService=getHadoopDistributionService();
      if (hadoopService != null && newDistribution != null) {
        doSupportMapRTicket=hadoopService.doSupportMapRTicket(newDistribution.getDefaultVersion());
      }
      useMaprTForHBase.setEnabled(doSupportMapRTicket);
      hideControl(useMaprTForHBase,!doSupportMapRTicket);
      hideControl(authenticationMaprTComForHBase,!doSupportMapRTicket);
      hideControl(authenticationUserPassComForHBase,!doSupportMapRTicket);
      if (originalDistribution == null || !newDistribution.getName().equals(originalDistribution.getName())) {
        getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION,newDistribution.getName());
        updateHBaseVersionPart(newDistribution);
        fillDefaultsWhenHBaseVersionChanged();
        checkFieldsValue();
      }
    }
  }
);
  hbaseVersionCombo.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (isContextMode()) {
        return;
      }
      String originalDistributionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
      IHDistribution originalDistribution=getHBaseDistribution(originalDistributionName,false);
      if (originalDistribution == null) {
        return;
      }
      String newVersionDisplayName=StringUtils.trimToNull(hbaseVersionCombo.getText());
      IHDistributionVersion newVersion=originalDistribution.getHDVersion(newVersionDisplayName,true);
      if (newVersion == null) {
        return;
      }
      String originalVersionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
      IHDistributionVersion originalVersion=originalDistribution.getHDVersion(originalVersionName,false);
      if (originalVersion == null || newVersion.getVersion() != null && !newVersion.getVersion().equals(originalVersion.getVersion())) {
        getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION,newVersion.getVersion());
        fillDefaultsWhenHBaseVersionChanged();
        checkFieldsValue();
      }
    }
  }
);
  hbaseCustomButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      handleHadoopCustomVersion(ECustomVersionType.HBASE);
    }
  }
);
}

Fixed version (ground truth):
private void addHBaseSettingFieldsListeners(){
  hbaseDistributionCombo.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (isContextMode()) {
        return;
      }
      IHDistribution newDistribution=getHBaseDistribution(hbaseDistributionCombo.getText(),true);
      if (newDistribution == null) {
        return;
      }
      String originalDistributionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
      IHDistribution originalDistribution=getHBaseDistribution(originalDistributionName,false);
      boolean doSupportMapRTicket=false;
      IHadoopDistributionService hadoopService=getHadoopDistributionService();
      if (hadoopService != null && newDistribution != null) {
        doSupportMapRTicket=hadoopService.doSupportMapRTicket(newDistribution.getDefaultVersion());
      }
      useMaprTForHBase.setEnabled(doSupportMapRTicket);
      hideControl(useMaprTForHBase,!doSupportMapRTicket);
      hideControl(authenticationMaprTComForHBase,!useMaprTForHBase.getSelection());
      hideControl(authenticationUserPassComForHBase,!useMaprTForHBase.getSelection());
      if (originalDistribution == null || !newDistribution.getName().equals(originalDistribution.getName())) {
        getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION,newDistribution.getName());
        updateHBaseVersionPart(newDistribution);
        fillDefaultsWhenHBaseVersionChanged();
        checkFieldsValue();
      }
    }
  }
);
  hbaseVersionCombo.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (isContextMode()) {
        return;
      }
      String originalDistributionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
      IHDistribution originalDistribution=getHBaseDistribution(originalDistributionName,false);
      if (originalDistribution == null) {
        return;
      }
      String newVersionDisplayName=StringUtils.trimToNull(hbaseVersionCombo.getText());
      IHDistributionVersion newVersion=originalDistribution.getHDVersion(newVersionDisplayName,true);
      if (newVersion == null) {
        return;
      }
      String originalVersionName=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
      IHDistributionVersion originalVersion=originalDistribution.getHDVersion(originalVersionName,false);
      if (originalVersion == null || newVersion.getVersion() != null && !newVersion.getVersion().equals(originalVersion.getVersion())) {
        getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION,newVersion.getVersion());
        fillDefaultsWhenHBaseVersionChanged();
        checkFieldsValue();
      }
    }
  }
);
  hbaseCustomButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      handleHadoopCustomVersion(ECustomVersionType.HBASE);
    }
  }
);
}