Program: 104380
Project: 104380
Buggy source:
/** 
 * Sets to CONNECTED that state of the corresponding call participant and sends an ACK.
 * @param clientTransaction the <tt>ClientTransaction</tt> that the responsearrived in.
 * @param ok the OK <tt>Response</tt> to process
 */
private void processInviteOK(ClientTransaction clientTransaction,Response ok){
  Dialog dialog=clientTransaction.getDialog();
  CallParticipantSipImpl callParticipant=activeCallsRepository.findCallParticipant(dialog);
  if (callParticipant == null) {
    logger.debug("String_Node_Str");
    return;
  }
  if (callParticipant.getState() == CallParticipantState.CONNECTED) {
    logger.debug("String_Node_Str" + "String_Node_Str");
    return;
  }
  Request ack=null;
  ContentTypeHeader contentTypeHeader=null;
  try {
    ack=clientTransaction.getDialog().createRequest(Request.ACK);
    contentTypeHeader=protocolProvider.getHeaderFactory().createContentTypeHeader("String_Node_Str","String_Node_Str");
  }
 catch (  ParseException ex) {
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str");
    logger.error("String_Node_Str",ex);
  }
catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    callParticipant.setState(CallParticipantState.FAILED);
    return;
  }
  callParticipant.setSdpDescription(new String(ok.getRawContent()));
  CallSession callSession=((CallSipImpl)callParticipant.getCall()).getMediaCallSession();
  try {
    if (callSession == null) {
      callSession=SipActivator.getMediaService().createCallSession(callParticipant.getCall());
      String sdp=callSession.processSdpOffer(callParticipant,callParticipant.getSdpDescription());
      ack.setContent(sdp,contentTypeHeader);
    }
    callSession.processSdpAnswer(callParticipant,callParticipant.getSdpDescription());
  }
 catch (  ParseException exc) {
    logger.error("String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str",exc);
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str");
  }
catch (  MediaException exc) {
    logger.error("String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str"+ "String_Node_Str"+ exc.getMessage(),exc);
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str"+ "String_Node_Str"+ exc.getMessage());
  }
  try {
    clientTransaction.getDialog().sendAck(ack);
  }
 catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    callParticipant.setState(CallParticipantState.FAILED);
    return;
  }
  callParticipant.setState(CallParticipantState.CONNECTED);
}

Fixed version (ground truth):
/** 
 * Sets to CONNECTED that state of the corresponding call participant and sends an ACK.
 * @param clientTransaction the <tt>ClientTransaction</tt> that the responsearrived in.
 * @param ok the OK <tt>Response</tt> to process
 */
private void processInviteOK(ClientTransaction clientTransaction,Response ok){
  Dialog dialog=clientTransaction.getDialog();
  CallParticipantSipImpl callParticipant=activeCallsRepository.findCallParticipant(dialog);
  if (callParticipant == null) {
    logger.debug("String_Node_Str");
    return;
  }
  if (callParticipant.getState() == CallParticipantState.CONNECTED) {
    logger.debug("String_Node_Str" + "String_Node_Str");
    return;
  }
  Request ack=null;
  ContentTypeHeader contentTypeHeader=null;
  try {
    ack=clientTransaction.getDialog().createRequest(Request.ACK);
    contentTypeHeader=protocolProvider.getHeaderFactory().createContentTypeHeader("String_Node_Str","String_Node_Str");
  }
 catch (  ParseException ex) {
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str");
    logger.error("String_Node_Str",ex);
  }
catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    callParticipant.setState(CallParticipantState.FAILED);
    return;
  }
  callParticipant.setSdpDescription(new String(ok.getRawContent()));
  CallSession callSession=((CallSipImpl)callParticipant.getCall()).getMediaCallSession();
  try {
    try {
      if (callSession == null) {
        callSession=SipActivator.getMediaService().createCallSession(callParticipant.getCall());
        String sdp=callSession.processSdpOffer(callParticipant,callParticipant.getSdpDescription());
        ack.setContent(sdp,contentTypeHeader);
      }
    }
  finally {
      try {
        clientTransaction.getDialog().sendAck(ack);
      }
 catch (      SipException ex) {
        logger.error("String_Node_Str",ex);
        callParticipant.setState(CallParticipantState.FAILED);
        return;
      }
    }
    callSession.processSdpAnswer(callParticipant,callParticipant.getSdpDescription());
  }
 catch (  ParseException exc) {
    logger.error("String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str",exc);
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str");
  }
catch (  MediaException exc) {
    logger.error("String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str"+ "String_Node_Str"+ exc.getMessage(),exc);
    callParticipant.setState(CallParticipantState.FAILED,"String_Node_Str" + callParticipant.getDisplayName() + "String_Node_Str"+ callParticipant.getAddress()+ "String_Node_Str"+ "String_Node_Str"+ exc.getMessage());
  }
  callParticipant.setState(CallParticipantState.CONNECTED);
}