Program: 82016
Project: 82016
Buggy source:
/** 
 * {@inheritDoc}<p> <strong>Warning:</strong> This method will wait for the selected candidate pair which should be generated during establish ICE connectivity. However, sometimes selected pair can't be generated forever, in this case, this method will hang.
 */
@Override public StreamConnector getStreamConnector(MediaType mediaType) throws OperationFailedException {
  logger.info("String_Node_Str");
  if (streamConnectors.containsKey(mediaType))   return streamConnectors.get(mediaType);
  if (mediaType != MediaType.AUDIO && mediaType != MediaType.VIDEO)   return null;
  int sumWaitTime=0;
  while (sumWaitTime <= MAX_WAIT_TIME) {
    try {
      if (IceProcessingState.TERMINATED == iceAgent.getState())       break;
      logger.info("String_Node_Str" + sumWaitTime + "String_Node_Str");
      sumWaitTime+=MIN_WAIT_TIME;
      TimeUnit.SECONDS.sleep(MIN_WAIT_TIME);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (IceProcessingState.TERMINATED != iceAgent.getState()) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  StreamConnector streamConnector=null;
  IceMediaStream stream=getIceMediaStream(mediaType);
  if (null == stream) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  final CandidatePair rtpPair=stream.getComponent(Component.RTP).getSelectedPair();
  final CandidatePair rtcpPair=stream.getComponent(Component.RTCP).getSelectedPair();
  System.out.println(rtpPair);
  final DatagramSocket rtpSocket=rtpPair.getLocalCandidate().getDatagramSocket();
  final DatagramSocket rtcpSocket=rtcpPair.getLocalCandidate().getDatagramSocket();
  streamConnector=new DefaultStreamConnector(rtpSocket,rtcpSocket);
  streamConnectors.put(mediaType,streamConnector);
  return streamConnector;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p> <strong>Warning:</strong> This method will wait for the selected candidate pair which should be generated during establish ICE connectivity. However, sometimes selected pair can't be generated forever, in this case, this method will hang.
 */
@Override public StreamConnector getStreamConnector(MediaType mediaType) throws OperationFailedException {
  logger.info("String_Node_Str");
  if (streamConnectors.containsKey(mediaType))   return streamConnectors.get(mediaType);
  if (mediaType != MediaType.AUDIO && mediaType != MediaType.VIDEO)   return null;
  int sumWaitTime=0;
  while (sumWaitTime <= MAX_WAIT_TIME) {
    try {
      if (IceProcessingState.TERMINATED == iceAgent.getState())       break;
      logger.info("String_Node_Str" + sumWaitTime + "String_Node_Str");
      sumWaitTime+=MIN_WAIT_TIME;
      TimeUnit.SECONDS.sleep(MIN_WAIT_TIME);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (IceProcessingState.TERMINATED != iceAgent.getState()) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  StreamConnector streamConnector=null;
  IceMediaStream stream=getIceMediaStream(mediaType);
  if (null == stream) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  final CandidatePair rtpPair=stream.getComponent(Component.RTP).getSelectedPair();
  final CandidatePair rtcpPair=stream.getComponent(Component.RTCP).getSelectedPair();
  final DatagramSocket rtpSocket=rtpPair.getLocalCandidate().getDatagramSocket();
  final DatagramSocket rtcpSocket=rtcpPair.getLocalCandidate().getDatagramSocket();
  streamConnector=new DefaultStreamConnector(rtpSocket,rtcpSocket);
  streamConnectors.put(mediaType,streamConnector);
  return streamConnector;
}