Program: 104342
Project: 104342
Buggy source:
/** 
 * Sends the <tt>message</tt> to the destination indicated by the <tt>to</tt> contact.
 * @param to the <tt>Contact</tt> to send <tt>message</tt> to
 * @param message the <tt>Message</tt> to send.
 * @throws java.lang.IllegalStateException if the underlying stack isnot registered and initialized.
 * @throws java.lang.IllegalArgumentException if <tt>to</tt> is not aninstance of ContactImpl.
 */
public void sendInstantMessage(Contact to,Message message) throws IllegalStateException, IllegalArgumentException {
  if (!(to instanceof ContactSipImpl))   throw new IllegalArgumentException("String_Node_Str" + to);
  assertConnected();
  if (to.getPresenceStatus().equals(sipStatusEnum.getStatus(SipStatusEnum.OFFLINE)) && !offlineMessageSupported) {
    logger.debug("String_Node_Str");
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED,new Date());
    fireMessageEvent(evt);
    return;
  }
  Request mes;
  try {
    mes=createMessage(to,message);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.INTERNAL_ERROR,new Date());
    fireMessageEvent(evt);
    return;
  }
  sendRequestMessage(mes,to,message);
}

Fixed version (ground truth):
/** 
 * Sends the <tt>message</tt> to the destination indicated by the <tt>to</tt> contact.
 * @param to the <tt>Contact</tt> to send <tt>message</tt> to
 * @param message the <tt>Message</tt> to send.
 * @throws java.lang.IllegalStateException if the underlying stack isnot registered and initialized.
 * @throws java.lang.IllegalArgumentException if <tt>to</tt> is not aninstance of ContactImpl.
 */
public void sendInstantMessage(Contact to,Message message) throws IllegalStateException, IllegalArgumentException {
  if (!(to instanceof ContactSipImpl))   throw new IllegalArgumentException("String_Node_Str" + to);
  assertConnected();
  if (to.getPresenceStatus().equals(sipStatusEnum.getStatus(SipStatusEnum.OFFLINE)) && !offlineMessageSupported) {
    logger.debug("String_Node_Str");
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED,new Date());
    fireMessageEvent(evt);
    return;
  }
  Request mes;
  try {
    mes=createMessage(to,message);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.INTERNAL_ERROR,new Date());
    fireMessageEvent(evt);
    return;
  }
  try {
    sendRequestMessage(mes,to,message);
  }
 catch (  TransactionUnavailableException ex) {
    logger.error("String_Node_Str" + "String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.NETWORK_FAILURE,new Date());
    fireMessageEvent(evt);
    return;
  }
catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.INTERNAL_ERROR,new Date());
    fireMessageEvent(evt);
    return;
  }
}