Program: 124756
Project: 124756
Buggy source:
@Override public void updateForm(){
  HadoopClusterConnection connection=getConnection();
  final DistributionVersion distributionVersion=getDistributionVersion();
  if (distributionVersion.distribution.useCustom()) {
    hideControl(customGroup,false);
    String authModeName=connection.getAuthMode();
    if (authModeName != null) {
      EAuthenticationMode authMode=EAuthenticationMode.getAuthenticationByName(authModeName,false);
switch (authMode) {
case KRB:
        kerberosBtn.setEnabled(true);
      namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
    jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
  jobHistoryPrincipalText.setEditable(namenodePrincipalText.getEditable());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
userNameText.setEditable(false);
groupText.setEditable(false);
hideKerberosControl(!kerberosBtn.getSelection());
hideMaprTicketControl(true);
maprTPasswordText.setEditable(false);
break;
case UGI:
kerberosBtn.setEnabled(true);
namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
jobHistoryPrincipalText.setEditable(namenodePrincipalText.getEditable());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
userNameText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
groupText.setEditable(false);
hideKerberosControl(!kerberosBtn.getSelection());
hideMaprTicketChildControl(!maprTBtn.getSelection());
maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
break;
default :
kerberosBtn.setEnabled(false);
namenodePrincipalText.setEditable(false);
jtOrRmPrincipalText.setEditable(false);
jobHistoryPrincipalText.setEditable(false);
keytabBtn.setEnabled(false);
keytabPrincipalText.setEditable(false);
keytabText.setEditable(false);
userNameText.setEditable(true);
groupText.setEditable(false);
hideKerberosControl(true);
hideMaprTicketControl(true);
maprTPasswordText.setEditable(false);
break;
}
}
}
 else {
hideControl(customGroup,true);
kerberosBtn.setEnabled(isCurrentHadoopVersionSupportSecurity());
namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
jobHistoryPrincipalText.setEditable(namenodePrincipalText.getEditable() && isCurrentHadoopVersionSupportJobHistoryPrincipal());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
groupText.setEditable(isCurrentHadoopVersionSupportGroup());
userNameText.setEditable(!kerberosBtn.getSelection());
hideKerberosControl(!kerberosBtn.getSelection());
hideControl(maprTBtn,!isCurrentHadoopVersionSupportMapRTicket());
maprTBtn.setEnabled(isCurrentHadoopVersionSupportMapRTicket());
maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
setMaprTHomeDirBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
setHadoopLoginBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
preloadAuthentificationBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
hideMaprTicketChildControl(!maprTBtn.getSelection());
}
updateMRRelatedContent();
updateConnectionContent();
if (isContextMode()) {
adaptFormToEditable();
}
}

Fixed version (ground truth):
@Override public void updateForm(){
  HadoopClusterConnection connection=getConnection();
  final DistributionVersion distributionVersion=getDistributionVersion();
  if (distributionVersion.distribution.useCustom()) {
    hideControl(customGroup,false);
    String authModeName=connection.getAuthMode();
    if (authModeName != null) {
      EAuthenticationMode authMode=EAuthenticationMode.getAuthenticationByName(authModeName,false);
switch (authMode) {
case KRB:
        kerberosBtn.setEnabled(true);
      namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
    jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
  jobHistoryPrincipalText.setEditable(isJobHistoryPrincipalEditable());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
userNameText.setEditable(false);
groupText.setEditable(false);
hideKerberosControl(!kerberosBtn.getSelection());
hideMaprTicketControl(true);
maprTPasswordText.setEditable(false);
break;
case UGI:
kerberosBtn.setEnabled(true);
namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
jobHistoryPrincipalText.setEditable(namenodePrincipalText.getEditable());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
userNameText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
groupText.setEditable(false);
hideKerberosControl(!kerberosBtn.getSelection());
hideMaprTicketChildControl(!maprTBtn.getSelection());
maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
break;
default :
kerberosBtn.setEnabled(false);
namenodePrincipalText.setEditable(false);
jtOrRmPrincipalText.setEditable(false);
jobHistoryPrincipalText.setEditable(false);
keytabBtn.setEnabled(false);
keytabPrincipalText.setEditable(false);
keytabText.setEditable(false);
userNameText.setEditable(true);
groupText.setEditable(false);
hideKerberosControl(true);
hideMaprTicketControl(true);
maprTPasswordText.setEditable(false);
break;
}
}
}
 else {
hideControl(customGroup,true);
kerberosBtn.setEnabled(isCurrentHadoopVersionSupportSecurity());
namenodePrincipalText.setEditable(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
jtOrRmPrincipalText.setEditable(namenodePrincipalText.getEditable());
jobHistoryPrincipalText.setEditable(isJobHistoryPrincipalEditable());
keytabBtn.setEnabled(kerberosBtn.isEnabled() && kerberosBtn.getSelection());
keytabPrincipalText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
keytabText.setEditable(keytabBtn.isEnabled() && keytabBtn.getSelection());
groupText.setEditable(isCurrentHadoopVersionSupportGroup());
userNameText.setEditable(!kerberosBtn.getSelection());
hideKerberosControl(!kerberosBtn.getSelection());
hideControl(maprTBtn,!isCurrentHadoopVersionSupportMapRTicket());
maprTBtn.setEnabled(isCurrentHadoopVersionSupportMapRTicket());
maprTPasswordText.setEditable(maprTBtn.isEnabled() && (maprTBtn.getSelection() && !(kerberosBtn.isEnabled() && kerberosBtn.getSelection())));
maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
setMaprTHomeDirBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
setHadoopLoginBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
preloadAuthentificationBtn.setEnabled(maprTBtn.isEnabled() && maprTBtn.getSelection());
hideMaprTicketChildControl(!maprTBtn.getSelection());
}
updateMRRelatedContent();
updateConnectionContent();
if (isContextMode()) {
adaptFormToEditable();
}
}