Program: 104344
Project: 104344
Buggy source:
public void sendTypingNotification(Contact to,int typingState) throws IllegalStateException, IllegalArgumentException {
  assertConnected();
  if (!(to instanceof ContactSipImpl))   throw new IllegalArgumentException("String_Node_Str" + to);
  Document doc=opSetPersPresence.createDocument();
  Element rootEl=doc.createElementNS(NS_VALUE,"String_Node_Str");
  rootEl.setAttribute("String_Node_Str","String_Node_Str");
  doc.appendChild(rootEl);
  if (typingState == STATE_TYPING) {
    Element state=doc.createElement("String_Node_Str");
    Node stateValue=doc.createTextNode(COMPOSING_STATE_ACTIVE);
    state.appendChild(stateValue);
    rootEl.appendChild(state);
    Element refresh=doc.createElement("String_Node_Str");
    Node refreshValue=doc.createTextNode("String_Node_Str");
    refresh.appendChild(refreshValue);
    rootEl.appendChild(refresh);
  }
 else   if (typingState == STATE_STOPPED) {
    Element state=doc.createElement("String_Node_Str");
    Node stateValue=doc.createTextNode(COMPOSING_STATE_IDLE);
    state.appendChild(stateValue);
    rootEl.appendChild(state);
  }
 else   return;
  Message message=opSetBasicIm.createMessage(new String(opSetPersPresence.convertDocument(doc)).getBytes(),CONTENT_TYPE,OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING,null);
  Request mes;
  try {
    mes=opSetBasicIm.createMessage(to,message);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    return;
  }
  opSetBasicIm.sendRequestMessage(mes,to,message);
}

Fixed version (ground truth):
public void sendTypingNotification(Contact to,int typingState) throws IllegalStateException, IllegalArgumentException {
  assertConnected();
  if (!(to instanceof ContactSipImpl))   throw new IllegalArgumentException("String_Node_Str" + to);
  Document doc=opSetPersPresence.createDocument();
  Element rootEl=doc.createElementNS(NS_VALUE,"String_Node_Str");
  rootEl.setAttribute("String_Node_Str","String_Node_Str");
  doc.appendChild(rootEl);
  if (typingState == STATE_TYPING) {
    Element state=doc.createElement("String_Node_Str");
    Node stateValue=doc.createTextNode(COMPOSING_STATE_ACTIVE);
    state.appendChild(stateValue);
    rootEl.appendChild(state);
    Element refresh=doc.createElement("String_Node_Str");
    Node refreshValue=doc.createTextNode("String_Node_Str");
    refresh.appendChild(refreshValue);
    rootEl.appendChild(refresh);
  }
 else   if (typingState == STATE_STOPPED) {
    Element state=doc.createElement("String_Node_Str");
    Node stateValue=doc.createTextNode(COMPOSING_STATE_IDLE);
    state.appendChild(stateValue);
    rootEl.appendChild(state);
  }
 else   return;
  Message message=opSetBasicIm.createMessage(new String(opSetPersPresence.convertDocument(doc)).getBytes(),CONTENT_TYPE,OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING,null);
  Request mes;
  try {
    mes=opSetBasicIm.createMessage(to,message);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    return;
  }
  try {
    opSetBasicIm.sendRequestMessage(mes,to,message);
  }
 catch (  TransactionUnavailableException ex) {
    logger.error("String_Node_Str" + "String_Node_Str",ex);
    return;
  }
catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    return;
  }
}