Program: 103769
Project: 103769
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){
  logger.debug("String_Node_Str" + evt.getOldState() + "String_Node_Str"+ evt.getNewState());
  if (evt.getNewState() == RegistrationState.REGISTERED) {
    manager=new FileTransferManager(jabberProvider.getConnection());
    fileTransferRequestListener=new FileTransferRequestListener();
    ProviderManager.getInstance().addIQProvider(FileElement.ELEMENT_NAME,FileElement.NAMESPACE,new FileElement());
    ProviderManager.getInstance().addIQProvider(ThumbnailIQ.ELEMENT_NAME,ThumbnailIQ.NAMESPACE,new ThumbnailIQ());
    jabberProvider.getConnection().addPacketListener(fileTransferRequestListener,new AndFilter(new PacketTypeFilter(StreamInitiation.class),new IQTypeFilter(IQ.Type.SET)));
  }
 else   if (evt.getNewState() == RegistrationState.UNREGISTERED) {
    if (fileTransferRequestListener != null && jabberProvider.getConnection() != null) {
      jabberProvider.getConnection().removePacketListener(fileTransferRequestListener);
    }
    ProviderManager providerManager=ProviderManager.getInstance();
    if (providerManager != null) {
      ProviderManager.getInstance().removeIQProvider(FileElement.ELEMENT_NAME,FileElement.NAMESPACE);
      ProviderManager.getInstance().removeIQProvider(ThumbnailIQ.ELEMENT_NAME,ThumbnailIQ.NAMESPACE);
    }
    fileTransferRequestListener=null;
    manager=null;
  }
}

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){
  logger.debug("String_Node_Str" + evt.getOldState() + "String_Node_Str"+ evt.getNewState());
  if (evt.getNewState() == RegistrationState.REGISTERED) {
    opSetPersPresence=(OperationSetPersistentPresenceJabberImpl)jabberProvider.getOperationSet(OperationSetPersistentPresence.class);
    manager=new FileTransferManager(jabberProvider.getConnection());
    fileTransferRequestListener=new FileTransferRequestListener();
    ProviderManager.getInstance().addIQProvider(FileElement.ELEMENT_NAME,FileElement.NAMESPACE,new FileElement());
    ProviderManager.getInstance().addIQProvider(ThumbnailIQ.ELEMENT_NAME,ThumbnailIQ.NAMESPACE,new ThumbnailIQ());
    jabberProvider.getConnection().addPacketListener(fileTransferRequestListener,new AndFilter(new PacketTypeFilter(StreamInitiation.class),new IQTypeFilter(IQ.Type.SET)));
  }
 else   if (evt.getNewState() == RegistrationState.UNREGISTERED) {
    if (fileTransferRequestListener != null && jabberProvider.getConnection() != null) {
      jabberProvider.getConnection().removePacketListener(fileTransferRequestListener);
    }
    ProviderManager providerManager=ProviderManager.getInstance();
    if (providerManager != null) {
      ProviderManager.getInstance().removeIQProvider(FileElement.ELEMENT_NAME,FileElement.NAMESPACE);
      ProviderManager.getInstance().removeIQProvider(ThumbnailIQ.ELEMENT_NAME,ThumbnailIQ.NAMESPACE);
    }
    fileTransferRequestListener=null;
    manager=null;
  }
}