Program: 21097
Project: 21097
Buggy source:
protected void sendMessage(String channel2,String text){
  lastAction=System.currentTimeMillis();
  setNickAway(false);
  if (text.startsWith("String_Node_Str")) {
    int end=text.indexOf("String_Node_Str");
    if (end < 0) {
      end=text.length();
    }
    String cmd=text.substring(1,end);
    String rest=text.substring(end).trim();
    if (Regex.matches(cmd,CMD_PM)) {
      textField.setText("String_Node_Str");
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      conn.doPrivmsg(rest.substring(0,end).trim(),prepareToSend(rest.substring(end).trim()));
      lastCommand="String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str";
      addToText(null,STYLE_PM,"String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str"+ Utils.prepareMsg(rest.substring(end).trim()));
    }
 else     if (Regex.matches(cmd,CMD_SLAP)) {
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + "String_Node_Str"+ rest+ "String_Node_Str"+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + rest+ "String_Node_Str");
      lastCommand="String_Node_Str";
    }
 else     if (Regex.matches(cmd,CMD_ACTION)) {
      lastCommand="String_Node_Str";
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + prepareToSend(rest.trim())+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + Utils.prepareMsg(rest.trim()));
    }
 else     if (Regex.matches(cmd,CMD_VERSION)) {
      String msg="String_Node_Str" + JDUtilities.getJDTitle() + "String_Node_Str"+ JDUtilities.getJavaVersion()+ "String_Node_Str"+ OSDetector.getOSString()+ "String_Node_Str";
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + prepareToSend(msg)+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + Utils.prepareMsg(msg));
    }
 else     if (Regex.matches(cmd,CMD_MODE)) {
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      lastCommand="String_Node_Str";
      conn.doMode(CHANNEL,rest.trim());
    }
 else     if (Regex.matches(cmd,CMD_TRANSLATE)) {
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      String[] tofrom=rest.substring(0,end).trim().split("String_Node_Str");
      if (tofrom == null || tofrom.length != 2) {
        addToText(null,STYLE_ERROR,"String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str");
        return;
      }
      String t;
      t=JDLocale.translate(tofrom[0],tofrom[1],Utils.prepareMsg(rest.substring(end).trim()));
      lastCommand="String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str";
      textField.setText(t);
    }
 else     if (Regex.matches(cmd,CMD_TOPIC)) {
      conn.doTopic(CHANNEL,prepareToSend(rest));
      lastCommand="String_Node_Str";
    }
 else     if (Regex.matches(cmd,CMD_JOIN)) {
      conn.doJoin(CHANNEL,null);
      setLoggedIn(true);
      perform();
    }
 else     if (Regex.matches(cmd,CMD_NICK)) {
      conn.doNick(rest.trim());
      lastCommand="String_Node_Str";
      subConfig.setProperty(PARAM_NICK,rest.trim());
      subConfig.save();
    }
 else     if (Regex.matches(cmd,CMD_CONNECT)) {
      if (conn == null || !conn.isConnected()) {
        initIRC();
      }
    }
 else     if (Regex.matches(cmd,CMD_DISCONNECT)) {
      if (conn != null && conn.isConnected()) {
        conn.close();
      }
    }
 else     if (Regex.matches(cmd,CMD_EXIT)) {
      setEnabled(false);
    }
 else {
      addToText(null,STYLE_ERROR,"String_Node_Str" + cmd + "String_Node_Str");
    }
    textField.requestFocus();
  }
 else {
    conn.doPrivmsg(channel2,prepareToSend(text));
    addToText(getUser(conn.getNick()),STYLE_SELF,Utils.prepareMsg(text));
    textField.setText("String_Node_Str");
    textField.requestFocus();
  }
}

Fixed version (ground truth):
protected void sendMessage(String channel2,String text){
  lastAction=System.currentTimeMillis();
  setNickAway(false);
  if (text.startsWith("String_Node_Str")) {
    int end=text.indexOf("String_Node_Str");
    if (end < 0) {
      end=text.length();
    }
    String cmd=text.substring(1,end).trim();
    String rest=text.substring(end).trim();
    if (Regex.matches(cmd,CMD_PM)) {
      textField.setText("String_Node_Str");
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      conn.doPrivmsg(rest.substring(0,end).trim(),prepareToSend(rest.substring(end).trim()));
      lastCommand="String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str";
      addToText(null,STYLE_PM,"String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str"+ Utils.prepareMsg(rest.substring(end).trim()));
    }
 else     if (Regex.matches(cmd,CMD_SLAP)) {
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + "String_Node_Str"+ rest+ "String_Node_Str"+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + rest+ "String_Node_Str");
      lastCommand="String_Node_Str";
    }
 else     if (Regex.matches(cmd,CMD_ACTION)) {
      lastCommand="String_Node_Str";
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + prepareToSend(rest.trim())+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + Utils.prepareMsg(rest.trim()));
    }
 else     if (Regex.matches(cmd,CMD_VERSION)) {
      String msg="String_Node_Str" + JDUtilities.getJDTitle() + "String_Node_Str"+ JDUtilities.getJavaVersion()+ "String_Node_Str"+ OSDetector.getOSString()+ "String_Node_Str";
      conn.doPrivmsg(channel2,new String(new byte[]{1}) + "String_Node_Str" + prepareToSend(msg)+ new String(new byte[]{1}));
      addToText(null,STYLE_ACTION,conn.getNick() + "String_Node_Str" + Utils.prepareMsg(msg));
    }
 else     if (Regex.matches(cmd,CMD_MODE)) {
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      lastCommand="String_Node_Str";
      conn.doMode(CHANNEL,rest.trim());
    }
 else     if (Regex.matches(cmd,CMD_TRANSLATE)) {
      end=rest.indexOf("String_Node_Str");
      if (end < 0) {
        end=rest.length();
      }
      String[] tofrom=rest.substring(0,end).trim().split("String_Node_Str");
      if (tofrom == null || tofrom.length != 2) {
        addToText(null,STYLE_ERROR,"String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str");
        return;
      }
      String t;
      t=JDLocale.translate(tofrom[0],tofrom[1],Utils.prepareMsg(rest.substring(end).trim()));
      lastCommand="String_Node_Str" + rest.substring(0,end).trim() + "String_Node_Str";
      textField.setText(t);
    }
 else     if (Regex.matches(cmd,CMD_TOPIC)) {
      conn.doTopic(CHANNEL,prepareToSend(rest));
      lastCommand="String_Node_Str";
    }
 else     if (Regex.matches(cmd,CMD_JOIN)) {
      NAMES.clear();
      if (conn != null)       addToText(null,STYLE_NOTICE,"String_Node_Str" + rest);
      if (conn != null)       conn.doPart(CHANNEL,"String_Node_Str" + rest);
      CHANNEL=rest;
      if (conn != null)       conn.doJoin(CHANNEL,null);
      lastCommand="String_Node_Str" + rest;
      setLoggedIn(true);
      perform();
    }
 else     if (Regex.matches(cmd,CMD_NICK)) {
      conn.doNick(rest.trim());
      lastCommand="String_Node_Str";
      subConfig.setProperty(PARAM_NICK,rest.trim());
      subConfig.save();
    }
 else     if (Regex.matches(cmd,CMD_CONNECT)) {
      if (conn == null || !conn.isConnected()) {
        initIRC();
      }
    }
 else     if (Regex.matches(cmd,CMD_DISCONNECT)) {
      if (conn != null && conn.isConnected()) {
        conn.close();
      }
    }
 else     if (Regex.matches(cmd,CMD_EXIT)) {
      setEnabled(false);
    }
 else {
      addToText(null,STYLE_ERROR,"String_Node_Str" + cmd + "String_Node_Str");
    }
  }
 else {
    conn.doPrivmsg(channel2,prepareToSend(text));
    addToText(getUser(conn.getNick()),STYLE_SELF,Utils.prepareMsg(text));
  }
  textField.setText("String_Node_Str");
  textField.requestFocus();
}