Program: 103062
Project: 103062
Buggy source:
/** 
 * @override {@link SwingWorker}{@link #done()} to perform UI changesafter the chat room join task has finished.
 */
private void done(String returnCode){
  ConfigurationUtils.updateChatRoomStatus(chatRoomWrapper.getParentProvider().getProtocolProvider(),chatRoomWrapper.getChatRoomID(),GlobalStatusEnum.ONLINE_STATUS);
  String errorMessage=null;
  if (AUTHENTICATION_FAILED.equals(returnCode)) {
    chatRoomWrapper.removePassword();
    AuthenticationWindowService authWindowsService=ServiceUtils.getService(MUCActivator.bundleContext,AuthenticationWindowService.class);
    AuthenticationWindowService.AuthenticationWindow authWindow=authWindowsService.create(null,null,null,false,chatRoomWrapper.isPersistent(),ImageLoader.getAuthenticationWindowIcon(chatRoomWrapper.getParentProvider().getProtocolProvider()),resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getParentProvider().getName()}),resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()}),"String_Node_Str",null,isFirstAttempt ? null : resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()}),null);
    authWindow.setVisible(true);
    if (!authWindow.isCanceled()) {
      joinChatRoom(chatRoomWrapper,nickName,new String(authWindow.getPassword()).getBytes(),authWindow.isRememberPassword(),false,subject);
    }
  }
 else   if (REGISTRATION_REQUIRED.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else   if (PROVIDER_NOT_REGISTERED.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else   if (SUBSCRIPTION_ALREADY_EXISTS.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
  if (!SUCCESS.equals(returnCode) && !AUTHENTICATION_FAILED.equals(returnCode)) {
    MUCActivator.getAlertUIService().showAlertDialog(resources.getI18NString("String_Node_Str"),errorMessage);
  }
  if (SUCCESS.equals(returnCode)) {
    if (rememberPassword) {
      chatRoomWrapper.savePassword(new String(password));
    }
    if (subject != null) {
      try {
        chatRoomWrapper.getChatRoom().setSubject(subject);
      }
 catch (      OperationFailedException ex) {
        logger.warn("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Performs UI changes after the chat room join task has finished.
 * @param returnCode the result code from the chat room join task.
 */
private void done(String returnCode){
  ConfigurationUtils.updateChatRoomStatus(chatRoomWrapper.getParentProvider().getProtocolProvider(),chatRoomWrapper.getChatRoomID(),GlobalStatusEnum.ONLINE_STATUS);
  String errorMessage=null;
  if (AUTHENTICATION_FAILED.equals(returnCode)) {
    chatRoomWrapper.removePassword();
    AuthenticationWindowService authWindowsService=ServiceUtils.getService(MUCActivator.bundleContext,AuthenticationWindowService.class);
    AuthenticationWindowService.AuthenticationWindow authWindow=authWindowsService.create(null,null,null,false,chatRoomWrapper.isPersistent(),ImageLoader.getAuthenticationWindowIcon(chatRoomWrapper.getParentProvider().getProtocolProvider()),resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getParentProvider().getName()}),resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()}),"String_Node_Str",null,isFirstAttempt ? null : resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()}),null);
    authWindow.setVisible(true);
    if (!authWindow.isCanceled()) {
      joinChatRoom(chatRoomWrapper,nickName,new String(authWindow.getPassword()).getBytes(),authWindow.isRememberPassword(),false,subject);
    }
  }
 else   if (REGISTRATION_REQUIRED.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else   if (PROVIDER_NOT_REGISTERED.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else   if (SUBSCRIPTION_ALREADY_EXISTS.equals(returnCode)) {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
 else {
    errorMessage=resources.getI18NString("String_Node_Str",new String[]{chatRoomWrapper.getChatRoomName()});
  }
  if (!SUCCESS.equals(returnCode) && !AUTHENTICATION_FAILED.equals(returnCode)) {
    MUCActivator.getAlertUIService().showAlertDialog(resources.getI18NString("String_Node_Str"),errorMessage);
  }
  if (SUCCESS.equals(returnCode)) {
    if (rememberPassword) {
      chatRoomWrapper.savePassword(new String(password));
    }
    if (subject != null) {
      try {
        chatRoomWrapper.getChatRoom().setSubject(subject);
      }
 catch (      OperationFailedException ex) {
        logger.warn("String_Node_Str");
      }
    }
  }
}