Program: 102945
Project: 102945
Buggy source:
/** 
 * Creates a new call and sends a RINGING response.
 * @param jainSipProvider the provider containing<tt>sourceTransaction</tt>.
 * @param serverTran the transaction containing the received request.
 * @return CallPeerSipImpl the newly created call peer (the one that sentthe INVITE).
 */
public CallPeerSipImpl processInvite(SipProvider jainSipProvider,ServerTransaction serverTran){
  Request invite=serverTran.getRequest();
  final CallPeerSipImpl peer=createCallPeerFor(serverTran,jainSipProvider);
  CallInfoHeader infoHeader=(CallInfoHeader)invite.getHeader(CallInfoHeader.NAME);
  String alternativeIMPPAddress=null;
  if (infoHeader != null && infoHeader.getParameter("String_Node_Str") != null && infoHeader.getParameter("String_Node_Str").equals("String_Node_Str")) {
    alternativeIMPPAddress=infoHeader.getInfo().toString();
  }
  if (alternativeIMPPAddress != null)   peer.setAlternativeIMPPAddress(alternativeIMPPAddress);
  Response response=null;
  try {
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str");
    response=messageFactory.createResponse(Response.RINGING,invite);
    serverTran.sendResponse(response);
    if (serverTran instanceof SIPTransaction && !((SIPTransaction)serverTran).isReliable()) {
      final Timer timer=new Timer();
      CallPeerAdapter stateListener=new CallPeerAdapter(){
        @Override public void peerStateChanged(        CallPeerChangeEvent evt){
          if (!evt.getNewValue().equals(CallPeerState.INCOMING_CALL)) {
            timer.cancel();
            peer.removeCallPeerListener(this);
          }
        }
      }
;
      int interval=retransmitsRingingInterval;
      int delay=0;
      for (int i=0; i < MAX_RETRANSMISSIONS; i++) {
        delay+=interval;
        timer.schedule(new RingingResponseTask(response,serverTran,peer,timer,stateListener),delay);
        interval*=2;
      }
      peer.addCallPeerListener(stateListener);
    }
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + response);
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    peer.setState(CallPeerState.FAILED,"String_Node_Str" + ex.getMessage());
    return peer;
  }
  return peer;
}

Fixed version (ground truth):
/** 
 * Creates a new call and sends a RINGING response.
 * @param jainSipProvider the provider containing<tt>sourceTransaction</tt>.
 * @param serverTran the transaction containing the received request.
 * @return CallPeerSipImpl the newly created call peer (the one that sentthe INVITE).
 */
public CallPeerSipImpl processInvite(SipProvider jainSipProvider,ServerTransaction serverTran){
  Request invite=serverTran.getRequest();
  final CallPeerSipImpl peer=createCallPeerFor(serverTran,jainSipProvider);
  CallInfoHeader infoHeader=(CallInfoHeader)invite.getHeader(CallInfoHeader.NAME);
  String alternativeIMPPAddress=null;
  if (infoHeader != null && infoHeader.getParameter("String_Node_Str") != null && infoHeader.getParameter("String_Node_Str").equals("String_Node_Str")) {
    alternativeIMPPAddress=infoHeader.getInfo().toString();
  }
  if (alternativeIMPPAddress != null)   peer.setAlternativeIMPPAddress(alternativeIMPPAddress);
  Response response=null;
  try {
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str");
    response=messageFactory.createResponse(Response.RINGING,invite);
    serverTran.sendResponse(response);
    if (serverTran instanceof SIPTransaction && !((SIPTransaction)serverTran).isReliable() && peer.getState().equals(CallPeerState.INCOMING_CALL)) {
      final Timer timer=new Timer();
      CallPeerAdapter stateListener=new CallPeerAdapter(){
        @Override public void peerStateChanged(        CallPeerChangeEvent evt){
          if (!evt.getNewValue().equals(CallPeerState.INCOMING_CALL)) {
            timer.cancel();
            peer.removeCallPeerListener(this);
          }
        }
      }
;
      int interval=retransmitsRingingInterval;
      int delay=0;
      for (int i=0; i < MAX_RETRANSMISSIONS; i++) {
        delay+=interval;
        timer.schedule(new RingingResponseTask(response,serverTran,peer,timer,stateListener),delay);
        interval*=2;
      }
      peer.addCallPeerListener(stateListener);
    }
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + response);
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    peer.setState(CallPeerState.FAILED,"String_Node_Str" + ex.getMessage());
    return peer;
  }
  return peer;
}