Program: 17557
Project: 17557
Buggy source:
/** 
 * The method called by the editor.
 */
public void customizeDocumentCommand(IDocument doc,DocumentCommand docCommand){
  try {
    if (docCommand.text.length() > 1 && docCommand.text.compareTo("String_Node_Str") != 0) {
      return;
    }
    int pos=docCommand.text.compareTo("String_Node_Str");
    char beforeLastChar=' ';
    char firstCommandChar=(docCommand.text.length() > 0) ? docCommand.text.charAt(0) : ' ';
    if (docCommand.offset - 1 >= 0) {
      beforeLastChar=doc.getChar(docCommand.offset - 1);
    }
    System.out.println("String_Node_Str" + firstCommandChar + "String_Node_Str");
    if (docCommand.length > 0 && docCommand.text.length() == 0) {
      firstCommandChar='\b';
    }
switch (firstCommandChar) {
case '\b':
      handleDelete(doc,docCommand);
    return;
case '!':
  if (doc.getChar(docCommand.offset) == '<' && doc.getChar(docCommand.offset + 1) == '>') {
    handleHTMLComment(doc,docCommand);
  }
return;
case '>':
if (!this.autoInsert_CloseTags) {
if (doc.getChar(docCommand.offset) == '>') stepThrough(docCommand);
return;
}
handleClosingChevron(doc,docCommand,beforeLastChar);
return;
case '<':
if (!this.autoClose_Tags) return;
handleOpenChevron(docCommand);
return;
case '\"':
if (!this.autoClose_DoubleQuotes) return;
handleQuotes(doc,docCommand,firstCommandChar);
return;
case '\'':
if (!this.autoClose_SingleQuotes) return;
handleQuotes(doc,docCommand,firstCommandChar);
return;
default :
if ((docCommand.text.compareTo("String_Node_Str") != 0 && docCommand.text.compareTo("String_Node_Str") != 0) || docCommand.length != 0) {
return;
}
break;
}
if (isEnterInTag(doc,docCommand)) {
handleEnterInTag(doc,docCommand);
}
String prevLineWhitespace=getPrevLineWhiteSpace(doc,docCommand.offset);
docCommand.text+=prevLineWhitespace;
}
 catch (BadLocationException ex) {
System.err.println("String_Node_Str");
return;
}
}

Fixed version (ground truth):
/** 
 * The method called by the editor.
 */
public void customizeDocumentCommand(IDocument doc,DocumentCommand docCommand){
  try {
    if (docCommand.text.length() > 1 && docCommand.text.compareTo("String_Node_Str") != 0) {
      return;
    }
    int pos=docCommand.text.compareTo("String_Node_Str");
    char beforeLastChar=' ';
    char firstCommandChar=(docCommand.text.length() > 0) ? docCommand.text.charAt(0) : ' ';
    if (docCommand.offset - 1 >= 0) {
      beforeLastChar=doc.getChar(docCommand.offset - 1);
    }
    System.out.println("String_Node_Str" + firstCommandChar + "String_Node_Str");
    if (docCommand.length > 0 && docCommand.text.length() == 0) {
      firstCommandChar='\b';
    }
switch (firstCommandChar) {
case '\b':
      handleDelete(doc,docCommand);
    return;
case '!':
  if (doc.getChar(docCommand.offset) == '<' && doc.getChar(docCommand.offset + 1) == '>') {
    handleHTMLComment(doc,docCommand);
  }
return;
case '>':
if (!this.autoInsert_CloseTags) {
if (doc.getChar(docCommand.offset) == '>') stepThrough(docCommand);
return;
}
handleClosingChevron(doc,docCommand,beforeLastChar);
return;
case '<':
if (!this.autoClose_Tags) return;
handleOpenChevron(docCommand);
return;
case '\"':
if (!this.autoClose_DoubleQuotes) return;
handleQuotes(doc,docCommand,firstCommandChar);
return;
case '\'':
if (!this.autoClose_SingleQuotes) return;
handleQuotes(doc,docCommand,firstCommandChar);
return;
case '\t':
docCommand.text=this.indentString;
return;
default :
if ((docCommand.text.compareTo("String_Node_Str") != 0 && docCommand.text.compareTo("String_Node_Str") != 0) || docCommand.length != 0) {
return;
}
break;
}
if (isEnterInTag(doc,docCommand)) {
handleEnterInTag(doc,docCommand);
}
String prevLineWhitespace=getPrevLineWhiteSpace(doc,docCommand.offset);
docCommand.text+=prevLineWhitespace;
}
 catch (BadLocationException ex) {
System.err.println("String_Node_Str");
return;
}
}