Program: 103116
Project: 103116
Buggy source:
/** 
 * Unregisters the ProtocolProvider. Make sure to do it in separate thread so we don't block other processing.
 * @param pp the protocol provider to unregister.
 * @param reconnect if the protocol provider does not need unregisteringshall we trigger reconnect. Its true when call called from reconnect.
 * @param listener the listener used in reconnect method.
 * @param task the task to use for reconnection.
 */
private void unregister(final ProtocolProviderService pp,final boolean reconnect,final RegistrationStateChangeListener listener,final ReconnectTask task){
  unregisteringProviders.add(pp);
  new Thread(new Runnable(){
    public void run(){
      try {
        if (pp.getRegistrationState().equals(RegistrationState.UNREGISTERING) || pp.getRegistrationState().equals(RegistrationState.UNREGISTERED) || pp.getRegistrationState().equals(RegistrationState.CONNECTION_FAILED)) {
          if (reconnect) {
            if (listener != null)             pp.removeRegistrationStateChangeListener(listener);
            if (timer == null || task == null)             return;
            if (currentlyReconnecting.containsKey(pp))             currentlyReconnecting.remove(pp).cancel();
            currentlyReconnecting.put(pp,task);
            if (logger.isTraceEnabled())             logger.trace("String_Node_Str" + pp + "String_Node_Str"+ task.delay+ "String_Node_Str");
            timer.schedule(task,task.delay);
          }
          return;
        }
        pp.unregister();
      }
 catch (      Throwable t) {
        logger.error("String_Node_Str" + pp,t);
      }
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Unregisters the ProtocolProvider. Make sure to do it in separate thread so we don't block other processing.
 * @param pp the protocol provider to unregister.
 * @param reconnect if the protocol provider does not need unregisteringshall we trigger reconnect. Its true when call called from reconnect.
 * @param listener the listener used in reconnect method.
 * @param task the task to use for reconnection.
 */
private void unregister(final ProtocolProviderService pp,final boolean reconnect,final RegistrationStateChangeListener listener,final ReconnectTask task){
  unregisteringProviders.add(pp);
  new Thread(new Runnable(){
    public void run(){
      try {
        if (pp.getRegistrationState().equals(RegistrationState.UNREGISTERING) || pp.getRegistrationState().equals(RegistrationState.UNREGISTERED) || pp.getRegistrationState().equals(RegistrationState.CONNECTION_FAILED)) {
          if (reconnect) {
            if (listener != null)             pp.removeRegistrationStateChangeListener(listener);
            if (timer == null || task == null)             return;
            if (currentlyReconnecting.containsKey(pp))             currentlyReconnecting.remove(pp).cancel();
            currentlyReconnecting.put(pp,task);
            if (logger.isInfoEnabled())             logger.info("String_Node_Str" + pp.getAccountID().getDisplayName() + "String_Node_Str"+ task.delay+ "String_Node_Str");
            timer.schedule(task,task.delay);
          }
          return;
        }
        pp.unregister();
      }
 catch (      Throwable t) {
        logger.error("String_Node_Str" + pp,t);
      }
    }
  }
).start();
}