Program: 86388
Project: 86388
Buggy source:
/** 
 * acceptJingleSession create a accept-session Jingle message and send it to the initiator of the session. The initiator is taken from the From attribute  of the initiate-session message.
 */
private void acceptJingleSession(){
  IceMediaStreamGenerator iceMediaStreamGenerator=null;
  List<MediaFormat> listFormat=null;
  Map<String,ContentPacketExtension> contentMap=new HashMap<String,ContentPacketExtension>();
  ContentPacketExtension content=null;
  for (  ContentPacketExtension cpe : sessionInitiate.getContentList()) {
    if (cpe.getName().equalsIgnoreCase("String_Node_Str")) {
      content=HammerUtils.createDescriptionForDataContent(CreatorEnum.responder,SendersEnum.responder);
    }
 else {
      listFormat=JingleUtils.extractFormats(cpe.getFirstChildOfType(RtpDescriptionPacketExtension.class),ptRegistry);
      possibleFormatMap.put(cpe.getName(),listFormat);
      selectedFormat.put(cpe.getName(),HammerUtils.selectFormat(cpe.getName(),listFormat));
      content=JingleUtils.createDescription(CreatorEnum.responder,cpe.getName(),SendersEnum.responder,listFormat,null,ptRegistry,null);
    }
    contentMap.put(cpe.getName(),content);
  }
  contentMap.remove("String_Node_Str");
  iceMediaStreamGenerator=IceMediaStreamGenerator.getInstance();
  try {
    agent=iceMediaStreamGenerator.generateIceMediaStream(contentMap.keySet(),null,null);
  }
 catch (  IOException e) {
    System.err.println(e);
  }
  HammerUtils.addRemoteCandidateToAgent(agent,sessionInitiate.getContentList());
  HammerUtils.addLocalCandidateToContentList(agent,contentMap.values());
  mediaStreamMap=HammerUtils.generateMediaStream(selectedFormat,ptRegistry);
  Packet presencePacket=new Presence(Presence.Type.available);
  String recipient=serverInfo.getRoomName() + "String_Node_Str" + serverInfo.getMUCDomain();
  presencePacket.setTo(recipient);
  MediaPacketExtension mediaPacket=new MediaPacketExtension();
  for (  String key : mediaStreamMap.keySet()) {
    String str=String.valueOf(mediaStreamMap.get(key).getLocalSourceID());
    mediaPacket.addSource(key,str,MediaDirection.SENDONLY.toString());
  }
  presencePacket.addExtension(mediaPacket);
  connection.sendPacket(presencePacket);
  sessionAccept=JinglePacketFactory.createSessionAccept(sessionInitiate.getTo(),sessionInitiate.getFrom(),sessionInitiate.getSID(),contentMap.values());
  sessionAccept.setInitiator(sessionInitiate.getFrom());
  HammerUtils.addSSRCToContent(contentMap,mediaStreamMap);
  HammerUtils.setDtlsEncryptionOnTransport(mediaStreamMap,sessionAccept.getContentList(),sessionInitiate.getContentList());
  connection.sendPacket(sessionAccept);
  System.out.println("String_Node_Str");
  agent.startConnectivityEstablishment();
  while (IceProcessingState.TERMINATED != agent.getState()) {
    System.out.println("String_Node_Str");
    try {
      Thread.sleep(1500);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  HammerUtils.addSocketToMediaStream(agent,mediaStreamMap);
  for (  MediaStream stream : mediaStreamMap.values()) {
    SrtpControl control=stream.getSrtpControl();
    MediaType type=stream.getFormat().getMediaType();
    control.start(type);
  }
  for (  MediaStream stream : mediaStreamMap.values()) {
    stream.start();
  }
}

Fixed version (ground truth):
/** 
 * acceptJingleSession create a accept-session Jingle message and send it to the initiator of the session. The initiator is taken from the From attribute  of the initiate-session message.
 */
private void acceptJingleSession(){
  IceMediaStreamGenerator iceMediaStreamGenerator=null;
  List<MediaFormat> listFormat=null;
  Map<String,ContentPacketExtension> contentMap=new HashMap<String,ContentPacketExtension>();
  ContentPacketExtension content=null;
  for (  ContentPacketExtension cpe : sessionInitiate.getContentList()) {
    if (cpe.getName().equalsIgnoreCase("String_Node_Str")) {
      content=HammerUtils.createDescriptionForDataContent(CreatorEnum.responder,SendersEnum.both);
    }
 else {
      listFormat=JingleUtils.extractFormats(cpe.getFirstChildOfType(RtpDescriptionPacketExtension.class),ptRegistry);
      possibleFormatMap.put(cpe.getName(),listFormat);
      selectedFormat.put(cpe.getName(),HammerUtils.selectFormat(cpe.getName(),listFormat));
      content=JingleUtils.createDescription(CreatorEnum.responder,cpe.getName(),SendersEnum.both,listFormat,null,ptRegistry,null);
    }
    contentMap.put(cpe.getName(),content);
  }
  contentMap.remove("String_Node_Str");
  iceMediaStreamGenerator=IceMediaStreamGenerator.getInstance();
  try {
    agent=iceMediaStreamGenerator.generateIceMediaStream(contentMap.keySet(),null,null);
  }
 catch (  IOException e) {
    System.err.println(e);
  }
  HammerUtils.addRemoteCandidateToAgent(agent,sessionInitiate.getContentList());
  HammerUtils.addLocalCandidateToContentList(agent,contentMap.values());
  mediaStreamMap=HammerUtils.generateMediaStream(selectedFormat,ptRegistry);
  presencePacketWithSSRC=new Presence(Presence.Type.available);
  String recipient=serverInfo.getRoomName() + "String_Node_Str" + serverInfo.getMUCDomain()+ "String_Node_Str"+ username;
  presencePacketWithSSRC.setTo(recipient);
  presencePacketWithSSRC.addExtension(new Nick(username));
  MediaPacketExtension mediaPacket=new MediaPacketExtension();
  for (  String key : mediaStreamMap.keySet()) {
    String str=String.valueOf(mediaStreamMap.get(key).getLocalSourceID());
    mediaPacket.addSource(key,str,MediaDirection.SENDRECV.toString());
  }
  presencePacketWithSSRC.addExtension(mediaPacket);
  sessionAccept=JinglePacketFactory.createSessionAccept(sessionInitiate.getTo(),sessionInitiate.getFrom(),sessionInitiate.getSID(),contentMap.values());
  sessionAccept.setInitiator(sessionInitiate.getFrom());
  HammerUtils.addSSRCToContent(contentMap,mediaStreamMap);
  HammerUtils.setDtlsEncryptionOnTransport(mediaStreamMap,sessionAccept.getContentList(),sessionInitiate.getContentList());
  connection.sendPacket(sessionAccept);
  System.out.println("String_Node_Str");
  agent.startConnectivityEstablishment();
  while (IceProcessingState.TERMINATED != agent.getState()) {
    System.out.println("String_Node_Str");
    try {
      Thread.sleep(1500);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  HammerUtils.addSocketToMediaStream(agent,mediaStreamMap);
  for (  MediaStream stream : mediaStreamMap.values()) {
    SrtpControl control=stream.getSrtpControl();
    MediaType type=stream.getFormat().getMediaType();
    control.start(type);
  }
  for (  MediaStream stream : mediaStreamMap.values()) {
    stream.start();
  }
}