Program: 104369
Project: 104369
Buggy source:
/** 
 * The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred.
 * @param evt ProviderStatusChangeEvent the event describing the statuschange.
 */
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  ProtocolProviderService protocolProvider=evt.getProvider();
  AccountID accountID=protocolProvider.getAccountID();
  logger.trace("String_Node_Str" + protocolProvider + "String_Node_Str"+ evt.getNewState().getStateName());
  OperationSetPresence presence=mainFrame.getProtocolPresenceOpSet(protocolProvider);
  OperationSetMultiUserChat multiUserChat=mainFrame.getMultiUserChatOpSet(protocolProvider);
  if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    this.mainFrame.getStatusPanel().updateStatus(protocolProvider);
    if (mainFrame.getCallManager().containsCallAccount(protocolProvider)) {
      this.mainFrame.getCallManager().updateCallAccountStatus(protocolProvider);
    }
    if (presence != null) {
      presence.setAuthorizationHandler(new AuthorizationHandlerImpl(mainFrame));
    }
    if (multiUserChat != null) {
      mainFrame.getChatRoomsListPanel().getChatRoomsList().synchronizeOpSetWithLocalContactList(protocolProvider,multiUserChat);
    }
  }
 else   if (evt.getNewState().equals(RegistrationState.AUTHENTICATION_FAILED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_RECONNECTION_RATE_LIMIT_EXCEEDED) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
      new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
    }
 else     if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_NON_EXISTING_USER_ID) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
      new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
    }
 else     if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_AUTHENTICATION_FAILED) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
      new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
    }
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.CONNECTION_FAILED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
    new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.EXPIRED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
    new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.UNREGISTERED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    if (mainFrame.getCallManager().containsCallAccount(protocolProvider)) {
      this.mainFrame.getCallManager().updateCallAccountStatus(protocolProvider);
    }
    if (!manuallyDisconnected) {
      if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS) {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
        new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
      }
 else       if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_CLIENT_LIMIT_REACHED_FOR_IP) {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
        new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
      }
 else       if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_USER_REQUEST) {
      }
 else {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
        new ErrorDialog(null,msgText,Messages.getI18NString("String_Node_Str").getText()).showDialog();
      }
      logger.error(evt.getReason());
    }
  }
}

Fixed version (ground truth):
/** 
 * The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred.
 * @param evt ProviderStatusChangeEvent the event describing the statuschange.
 */
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  ProtocolProviderService protocolProvider=evt.getProvider();
  AccountID accountID=protocolProvider.getAccountID();
  logger.trace("String_Node_Str" + protocolProvider + "String_Node_Str"+ evt.getNewState().getStateName());
  OperationSetPresence presence=mainFrame.getProtocolPresenceOpSet(protocolProvider);
  OperationSetMultiUserChat multiUserChat=mainFrame.getMultiUserChatOpSet(protocolProvider);
  if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    this.mainFrame.getStatusPanel().updateStatus(protocolProvider);
    if (mainFrame.getCallManager().containsCallAccount(protocolProvider)) {
      this.mainFrame.getCallManager().updateCallAccountStatus(protocolProvider);
    }
    if (presence != null) {
      presence.setAuthorizationHandler(new AuthorizationHandlerImpl(mainFrame));
    }
    if (multiUserChat != null) {
      mainFrame.getChatRoomsListPanel().getChatRoomsList().synchronizeOpSetWithLocalContactList(protocolProvider,multiUserChat);
    }
  }
 else   if (evt.getNewState().equals(RegistrationState.AUTHENTICATION_FAILED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_RECONNECTION_RATE_LIMIT_EXCEEDED) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
      new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
    }
 else     if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_NON_EXISTING_USER_ID) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
      new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
    }
 else     if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_AUTHENTICATION_FAILED) {
      String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
      new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
    }
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.CONNECTION_FAILED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
    new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.EXPIRED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
    new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
    logger.error(evt.getReason());
  }
 else   if (evt.getNewState().equals(RegistrationState.UNREGISTERED)) {
    this.mainFrame.getStatusPanel().updateStatus(evt.getProvider());
    if (mainFrame.getCallManager().containsCallAccount(protocolProvider)) {
      this.mainFrame.getCallManager().updateCallAccountStatus(protocolProvider);
    }
    if (!manuallyDisconnected) {
      if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS) {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
        new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
      }
 else       if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_CLIENT_LIMIT_REACHED_FOR_IP) {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}).getText();
        new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
      }
 else       if (evt.getReasonCode() == RegistrationStateChangeEvent.REASON_USER_REQUEST) {
      }
 else {
        String msgText=Messages.getI18NString("String_Node_Str",new String[]{accountID.getUserID(),accountID.getService()}).getText();
        new ErrorDialog(null,Messages.getI18NString("String_Node_Str").getText(),msgText).showDialog();
      }
      logger.error(evt.getReason());
    }
  }
}