Program: 36283
Project: 36283
Buggy source:
protected void handleREPLModeCommand(String command,JTextArea component){
  boolean isDone=true;
  boolean refresh=false;
  String firstCommandWord=command.split("String_Node_Str")[0];
  if (command.equals(CommandList.CLEAR_COMMAND)) {
    openLeftCurlies=0;
    isContinuing=false;
    component.setText(prompt);
    rowStartPosition=0;
  }
 else   if (firstCommandWord.equals(CommandList.INIT_COMMAND)) {
    isDone=handleInit(command,false);
    component.setText(prompt + command + '\n'+ prompt);
    try {
      int cp=consoleArea.getCaretPosition();
      rowStartPosition=Utilities.getRowStart(consoleArea,cp);
      refresh=true;
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (firstCommandWord.equals(CommandList.RESIZE_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleInit(command,true);
      component.replaceSelection(prompt);
      refresh=true;
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (firstCommandWord.equals(CommandList.UNDO_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleUndo(command,false);
      component.replaceSelection(prompt);
      refresh=true;
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (firstCommandWord.equals(CommandList.REDO_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleUndo(command,true);
      component.replaceSelection(prompt);
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (firstCommandWord.equals(CommandList.PRINT_COMMAND)) {
    isDone=false;
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      component.replaceSelection(promptContinuation);
    }
 else {
      handlePrintCode(command);
      component.replaceSelection(prompt);
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (firstCommandWord.equals(CommandList.HELP_COMMAND)) {
    isDone=false;
    handleHelp(command);
    if (isContinuing) {
      component.replaceSelection(promptContinuation);
    }
 else {
      component.replaceSelection(prompt);
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else   if (command.equals(CommandList.MAN_COMMAND)) {
    printStatusMessage("String_Node_Str" + "String_Node_Str");
    if (isContinuing) {
      component.replaceSelection(promptContinuation);
    }
 else {
      component.replaceSelection(prompt);
    }
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
  prefixLength=prompt.length();
  runTempSketch(!isDone,refresh);
}

Fixed version (ground truth):
protected void handleREPLModeCommand(String command,JTextArea component){
  boolean isDone=true;
  boolean refresh=false;
  String firstCommandWord=command.split("String_Node_Str")[0];
  if (command.equals(CommandList.CLEAR_COMMAND)) {
    openLeftCurlies=0;
    isContinuing=false;
    component.setText(prompt);
  }
 else   if (firstCommandWord.equals(CommandList.INIT_COMMAND)) {
    isDone=handleInit(command,false);
    if (isDone) {
      component.setText(prompt + command + '\n'+ prompt);
      openLeftCurlies=0;
      isContinuing=false;
    }
 else     if (isContinuing) {
      component.replaceSelection(promptContinuation);
    }
 else {
      component.replaceSelection(prompt);
    }
  }
 else   if (firstCommandWord.equals(CommandList.RESIZE_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleInit(command,true);
      component.replaceSelection(prompt);
      refresh=true;
    }
  }
 else   if (firstCommandWord.equals(CommandList.UNDO_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleUndo(command,false);
      component.replaceSelection(prompt);
      refresh=true;
    }
  }
 else   if (firstCommandWord.equals(CommandList.REDO_COMMAND)) {
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      isDone=false;
      component.replaceSelection(promptContinuation);
    }
 else {
      isDone=handleUndo(command,true);
      component.replaceSelection(prompt);
    }
  }
 else   if (firstCommandWord.equals(CommandList.PRINT_COMMAND)) {
    isDone=false;
    if (isContinuing) {
      printStatusMessage("String_Node_Str");
      component.replaceSelection(promptContinuation);
    }
 else {
      handlePrintCode(command);
      component.replaceSelection(prompt);
    }
  }
 else   if (firstCommandWord.equals(CommandList.HELP_COMMAND)) {
    isDone=false;
    handleHelp(command);
    if (isContinuing) {
      component.replaceSelection(promptContinuation);
    }
 else {
      component.replaceSelection(prompt);
    }
  }
 else   if (command.equals(CommandList.MAN_COMMAND)) {
    printStatusMessage("String_Node_Str" + "String_Node_Str");
    if (isContinuing) {
      component.replaceSelection(promptContinuation);
    }
 else {
      component.replaceSelection(prompt);
    }
  }
  if (isContinuing) {
    prefixLength=promptContinuation.length();
  }
 else {
    prefixLength=prompt.length();
  }
  if (command.equals(CommandList.CLEAR_COMMAND)) {
    rowStartPosition=0;
  }
 else   if (firstCommandWord.equals(CommandList.INIT_COMMAND) && isDone) {
    try {
      int cp=consoleArea.getCaretPosition();
      rowStartPosition=Utilities.getRowStart(consoleArea,cp);
      refresh=true;
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
 else {
    try {
      rowStartPosition=Math.max(rowStartPosition,Utilities.getRowStart(consoleArea,consoleArea.getCaretPosition()));
    }
 catch (    BadLocationException e1) {
      e1.printStackTrace();
    }
  }
  runTempSketch(!isDone,refresh);
}