Program: 124781
Project: 124781
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);
break;
case UGI:
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(true);
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);
maprTBtn.setEnabled(false);
maprTPasswordText.setEditable(false);
maprTClusterText.setEditable(false);
maprTDurationText.setEditable(false);
setMaprTHomeDirBtn.setEnabled(false);
setHadoopLoginBtn.setEnabled(false);
preloadAuthentificationBtn.setEnabled(false);
maprTHomeDirText.setEditable(false);
maprTHadoopLoginText.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());
if (kerberosBtn.getSelection()) {
hideControl(authNodejtOrRmHistoryComposite,false);
hideControl(authKeytabComposite,false);
}
 else {
hideControl(authNodejtOrRmHistoryComposite,true);
hideControl(authKeytabComposite,true);
}
authCommonComposite.layout();
authCommonComposite.getParent().layout();
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());
maprTHomeDirText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection() && setMaprTHomeDirBtn.isEnabled()&& setMaprTHomeDirBtn.getSelection());
maprTHadoopLoginText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection() && setHadoopLoginBtn.isEnabled()&& setHadoopLoginBtn.getSelection());
if (maprTBtn.getSelection()) {
hideControl(maprTPCDCompposite,false);
hideControl(maprTSetComposite,false);
}
 else {
hideControl(maprTPCDCompposite,true);
hideControl(maprTSetComposite,true);
}
authMaprTComposite.layout();
authMaprTComposite.getParent().layout();
}
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(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);
break;
case UGI:
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(true);
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);
hideControl(maprTBtn,true);
hideControl(maprTPCDCompposite,true);
hideControl(maprTSetComposite,true);
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());
if (kerberosBtn.getSelection()) {
hideControl(authNodejtOrRmHistoryComposite,false);
hideControl(authKeytabComposite,false);
}
 else {
hideControl(authNodejtOrRmHistoryComposite,true);
hideControl(authKeytabComposite,true);
}
authCommonComposite.layout();
authCommonComposite.getParent().layout();
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());
maprTHomeDirText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection() && setMaprTHomeDirBtn.isEnabled()&& setMaprTHomeDirBtn.getSelection());
maprTHadoopLoginText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection() && setHadoopLoginBtn.isEnabled()&& setHadoopLoginBtn.getSelection());
if (maprTBtn.getSelection()) {
hideControl(maprTPCDCompposite,false);
hideControl(maprTSetComposite,false);
}
 else {
hideControl(maprTPCDCompposite,true);
hideControl(maprTSetComposite,true);
}
authMaprTComposite.layout();
authMaprTComposite.getParent().layout();
}
updateMRRelatedContent();
updateConnectionContent();
if (isContextMode()) {
adaptFormToEditable();
}
}