Program: 103115
Project: 103115
Buggy source:
/** 
 * Starts the registration process. Connection details such as registration server, user name/number are provided through the configuration service through implementation specific properties.
 * @param authority the security authority that will be used for resolvingany security challenges that may be returned during the registration or at any moment while we're registered.
 * @throws OperationFailedException with the corresponding code it theregistration fails for some reason (e.g. a networking error or an implementation problem).
 */
public void register(final SecurityAuthority authority) throws OperationFailedException {
  if (authority == null)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  this.authority=authority;
  try {
    abortConnecting=false;
synchronized (connectAndLoginLock) {
      inConnectAndLogin=true;
    }
    connectAndLogin(authority,SecurityAuthority.AUTHENTICATION_REQUIRED);
  }
 catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    eventDuringLogin=null;
    fireRegistrationStateChanged(ex);
  }
 finally {
synchronized (connectAndLoginLock) {
      if (eventDuringLogin != null) {
        if (eventDuringLogin.getNewState().equals(RegistrationState.CONNECTION_FAILED) || eventDuringLogin.getNewState().equals(RegistrationState.UNREGISTERED))         disconnectAndCleanConnection();
        fireRegistrationStateChanged(eventDuringLogin.getOldState(),eventDuringLogin.getNewState(),eventDuringLogin.getReasonCode(),eventDuringLogin.getReason());
        eventDuringLogin=null;
        inConnectAndLogin=false;
        return;
      }
      inConnectAndLogin=false;
    }
  }
}

Fixed version (ground truth):
/** 
 * Starts the registration process. Connection details such as registration server, user name/number are provided through the configuration service through implementation specific properties.
 * @param authority the security authority that will be used for resolvingany security challenges that may be returned during the registration or at any moment while we're registered.
 * @throws OperationFailedException with the corresponding code it theregistration fails for some reason (e.g. a networking error or an implementation problem).
 */
public void register(final SecurityAuthority authority) throws OperationFailedException {
  if (authority == null)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  this.authority=authority;
  try {
    abortConnecting=false;
synchronized (connectAndLoginLock) {
      inConnectAndLogin=true;
    }
    initializeConnectAndLogin(authority,SecurityAuthority.AUTHENTICATION_REQUIRED);
  }
 catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    eventDuringLogin=null;
    fireRegistrationStateChanged(ex);
  }
 finally {
synchronized (connectAndLoginLock) {
      if (eventDuringLogin != null) {
        if (eventDuringLogin.getNewState().equals(RegistrationState.CONNECTION_FAILED) || eventDuringLogin.getNewState().equals(RegistrationState.UNREGISTERED))         disconnectAndCleanConnection();
        fireRegistrationStateChanged(eventDuringLogin.getOldState(),eventDuringLogin.getNewState(),eventDuringLogin.getReasonCode(),eventDuringLogin.getReason());
        eventDuringLogin=null;
        inConnectAndLogin=false;
        return;
      }
      inConnectAndLogin=false;
    }
  }
}