Program: 104258
Project: 104258
Buggy source:
/** 
 * Stops and closes all streams currently handled by <tt>rtpManager</tt>.
 * @param rtpManager the rtpManager whose streams we'll be stopping.
 * @return <tt>true</tt> if there was an actual change in the streaming i.e.the streaming wasn't already stopped before this request; <tt>false</tt>, otherwise
 */
private boolean stopStreaming(RTPManager rtpManager){
  boolean stoppedAtLeastOneStream=false;
  Vector<SendStream> sendStreams=rtpManager.getSendStreams();
  Iterator<SendStream> ssIter=sendStreams.iterator();
  while (ssIter.hasNext()) {
    SendStream stream=(SendStream)ssIter.next();
    try {
      stream.getDataSource().stop();
      stream.stop();
      stream.close();
    }
 catch (    IOException ex) {
      logger.warn("String_Node_Str",ex);
    }
    stoppedAtLeastOneStream=true;
  }
  Vector<ReceiveStream> receiveStreams=rtpManager.getReceiveStreams();
  Iterator<ReceiveStream> rsIter=receiveStreams.iterator();
  while (rsIter.hasNext()) {
    ReceiveStream stream=rsIter.next();
    try {
      stream.getDataSource().stop();
    }
 catch (    IOException ex) {
      logger.warn("String_Node_Str",ex);
    }
    stoppedAtLeastOneStream=true;
  }
  if (selectedKeyProviderAlgorithm != null && selectedKeyProviderAlgorithm.getProviderType() == KeyProviderAlgorithm.ProviderType.ZRTP_PROVIDER) {
    TransformConnector transConnector=this.transConnectors.get(rtpManager);
    if (transConnector != null) {
      if (usingSRTP) {
        ZRTPTransformEngine engine=(ZRTPTransformEngine)transConnector.getEngine();
        engine.stopZrtp();
        engine.cleanup();
      }
      transConnector.removeTargets();
    }
  }
 else {
    rtpManager.removeTargets("String_Node_Str");
  }
  printFlowStatistics(rtpManager);
  rtpManager.removeReceiveStreamListener(this);
  rtpManager.removeSendStreamListener(this);
  rtpManager.removeSessionListener(this);
  rtpManager.dispose();
  return stoppedAtLeastOneStream;
}

Fixed version (ground truth):
/** 
 * Stops and closes all streams currently handled by <tt>rtpManager</tt>.
 * @param rtpManager the rtpManager whose streams we'll be stopping.
 * @return <tt>true</tt> if there was an actual change in the streaming i.e.the streaming wasn't already stopped before this request; <tt>false</tt>, otherwise
 */
private boolean stopStreaming(RTPManager rtpManager){
  boolean stoppedAtLeastOneStream=false;
  Vector<SendStream> sendStreams=rtpManager.getSendStreams();
  Iterator<SendStream> ssIter=sendStreams.iterator();
  while (ssIter.hasNext()) {
    SendStream stream=(SendStream)ssIter.next();
    try {
      stream.getDataSource().stop();
      stream.stop();
      stream.close();
    }
 catch (    IOException ex) {
      logger.warn("String_Node_Str",ex);
    }
    stoppedAtLeastOneStream=true;
  }
  Vector<ReceiveStream> receiveStreams=rtpManager.getReceiveStreams();
  Iterator<ReceiveStream> rsIter=receiveStreams.iterator();
  while (rsIter.hasNext()) {
    ReceiveStream stream=rsIter.next();
    try {
      stream.getDataSource().stop();
    }
 catch (    IOException ex) {
      logger.warn("String_Node_Str",ex);
    }
    stoppedAtLeastOneStream=true;
  }
  if (selectedKeyProviderAlgorithm != null && selectedKeyProviderAlgorithm.getProviderType() == KeyProviderAlgorithm.ProviderType.ZRTP_PROVIDER) {
    TransformConnector transConnector=this.transConnectors.get(rtpManager);
    if (transConnector != null) {
      if (usingZRTP) {
        ZRTPTransformEngine engine=(ZRTPTransformEngine)transConnector.getEngine();
        engine.stopZrtp();
        engine.cleanup();
      }
      transConnector.removeTargets();
    }
  }
 else {
    rtpManager.removeTargets("String_Node_Str");
  }
  printFlowStatistics(rtpManager);
  rtpManager.removeReceiveStreamListener(this);
  rtpManager.removeSendStreamListener(this);
  rtpManager.removeSessionListener(this);
  rtpManager.dispose();
  return stoppedAtLeastOneStream;
}