Program: 103590
Project: 103590
Buggy source:
/** 
 * Implements <tt>connectionClosedOnError</tt> from <tt>ConnectionListener</tt>.
 * @param exception contains information on the error.
 */
public void connectionClosedOnError(Exception exception){
  logger.error("String_Node_Str" + exception.getLocalizedMessage());
  if (exception instanceof XMPPException) {
    StreamError err=((XMPPException)exception).getStreamError();
    if (err != null && err.getCode().equals(XMPPError.Condition.conflict.toString())) {
synchronized (connectAndLoginLock) {
        if (inConnectAndLogin) {
          eventDuringLogin=new RegistrationStateChangeEvent(ProtocolProviderServiceJabberImpl.this,getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS,"String_Node_Str");
          return;
        }
      }
      fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS,"String_Node_Str");
      return;
    }
  }
 else   if (exception instanceof SSLHandshakeException && exception.getCause() instanceof CertificateException) {
    return;
  }
synchronized (connectAndLoginLock) {
    if (inConnectAndLogin) {
      eventDuringLogin=new RegistrationStateChangeEvent(ProtocolProviderServiceJabberImpl.this,getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_NOT_SPECIFIED,exception.getMessage());
      return;
    }
  }
  fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_NOT_SPECIFIED,exception.getMessage());
}

Fixed version (ground truth):
/** 
 * Implements <tt>connectionClosedOnError</tt> from <tt>ConnectionListener</tt>.
 * @param exception contains information on the error.
 */
public void connectionClosedOnError(Exception exception){
  logger.error("String_Node_Str" + exception.getLocalizedMessage());
  if (exception instanceof XMPPException) {
    StreamError err=((XMPPException)exception).getStreamError();
    if (err != null && err.getCode().equals(XMPPError.Condition.conflict.toString())) {
synchronized (connectAndLoginLock) {
        if (inConnectAndLogin) {
          eventDuringLogin=new RegistrationStateChangeEvent(ProtocolProviderServiceJabberImpl.this,getRegistrationState(),RegistrationState.UNREGISTERED,RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS,"String_Node_Str");
          return;
        }
      }
      fireRegistrationStateChanged(getRegistrationState(),RegistrationState.UNREGISTERED,RegistrationStateChangeEvent.REASON_MULTIPLE_LOGINS,"String_Node_Str");
      return;
    }
  }
 else   if (exception instanceof SSLHandshakeException && exception.getCause() instanceof CertificateException) {
    return;
  }
synchronized (connectAndLoginLock) {
    if (inConnectAndLogin) {
      eventDuringLogin=new RegistrationStateChangeEvent(ProtocolProviderServiceJabberImpl.this,getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_NOT_SPECIFIED,exception.getMessage());
      return;
    }
  }
  fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_NOT_SPECIFIED,exception.getMessage());
}