Program: 103963
Project: 103963
Buggy source:
/** 
 * Implements the <tt>ChatPanel.sendMessage</tt> method. Obtains the appropriate operation set and sends the message, contained in the write area, through it.
 */
protected void sendInstantMessage(){
  String htmlText=getTextFromWriteArea("String_Node_Str");
  String plainText=getTextFromWriteArea(OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE);
  String messageText;
  String mimeType;
  if ((htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1)) {
    messageText=htmlText;
    mimeType=OperationSetBasicInstantMessaging.HTML_MIME_TYPE;
  }
 else {
    messageText=plainText;
    mimeType=OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE;
  }
  try {
    chatSession.getCurrentChatTransport().sendInstantMessage(messageText,mimeType);
  }
 catch (  IllegalStateException ex) {
    logger.error("String_Node_Str",ex);
    this.addMessage(chatSession.getCurrentChatTransport().getName(),System.currentTimeMillis(),Chat.OUTGOING_MESSAGE,messageText,mimeType);
    this.addErrorMessage(chatSession.getCurrentChatTransport().getName(),GuiActivator.getResources().getI18NString("String_Node_Str"));
  }
catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    this.refreshWriteArea();
    this.addMessage(chatSession.getCurrentChatTransport().getName(),System.currentTimeMillis(),Chat.OUTGOING_MESSAGE,messageText,mimeType);
    this.addErrorMessage(chatSession.getCurrentChatTransport().getName(),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{ex.getMessage()}));
  }
  if (chatSession.getCurrentChatTransport().allowsTypingNotifications()) {
    getChatWritePanel().stopTypingTimer();
  }
  this.refreshWriteArea();
  this.requestFocusInWriteArea();
}

Fixed version (ground truth):
/** 
 * Implements the <tt>ChatPanel.sendMessage</tt> method. Obtains the appropriate operation set and sends the message, contained in the write area, through it.
 */
protected void sendInstantMessage(){
  String htmlText=getTextFromWriteArea("String_Node_Str");
  String plainText=getTextFromWriteArea(OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE);
  String messageText;
  String mimeType;
  if ((htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1 || htmlText.indexOf("String_Node_Str") > -1)) {
    messageText=htmlText;
    mimeType=OperationSetBasicInstantMessaging.HTML_MIME_TYPE;
  }
 else {
    messageText=plainText;
    mimeType=OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE;
  }
  try {
    chatSession.getCurrentChatTransport().sendInstantMessage(messageText,mimeType);
  }
 catch (  IllegalStateException ex) {
    logger.error("String_Node_Str",ex);
    this.addMessage(chatSession.getCurrentChatTransport().getName(),System.currentTimeMillis(),Chat.OUTGOING_MESSAGE,messageText,mimeType);
    this.addErrorMessage(chatSession.getCurrentChatTransport().getName(),GuiActivator.getResources().getI18NString("String_Node_Str"));
  }
catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    this.refreshWriteArea();
    this.addMessage(chatSession.getCurrentChatTransport().getName(),System.currentTimeMillis(),Chat.OUTGOING_MESSAGE,messageText,mimeType);
    this.addErrorMessage(chatSession.getCurrentChatTransport().getName(),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{ex.getMessage()}));
  }
  if (chatSession.getCurrentChatTransport().allowsTypingNotifications()) {
    getChatWritePanel().stopTypingTimer();
  }
  this.refreshWriteArea();
}