Program: 17449
Project: 17449
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;
    }
    char beforeLastChar=' ';
    char firstCommandChar=(docCommand.text.length() > 0) ? docCommand.text.charAt(0) : ' ';
    if (docCommand.offset - 1 >= 0) {
      beforeLastChar=doc.getChar(docCommand.offset - 1);
    }
    if (docCommand.length > 0 && docCommand.text.length() == 0) {
      firstCommandChar='\b';
    }
switch (firstCommandChar) {
case '\b':
      handleDelete(doc,docCommand);
    return;
case '!':
  if (doc.getChar(docCommand.offset - 1) == '<' && doc.getLength() > docCommand.offset + 1 && doc.getChar(docCommand.offset + 1) == '>') {
    handleHTMLComment(doc,docCommand);
  }
return;
case '>':
if (!this.autoInsert_CloseTags) {
if (doc.getChar(docCommand.offset - 1) == '>') 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) {
super.customizeDocumentCommand(doc,docCommand);
return;
}
break;
}
if (isEnterInTag(doc,docCommand)) {
handleEnterInTag(doc,docCommand);
}
 else {
String prevLineWhitespace=getPrevLineWhiteSpace(doc,docCommand.offset);
docCommand.text+=prevLineWhitespace;
}
}
 catch (BadLocationException ex) {
System.err.println("String_Node_Str");
ex.printStackTrace();
return;
}
catch (Exception e) {
e.printStackTrace();
}
}

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;
    }
    char beforeLastChar=' ';
    char firstCommandChar=(docCommand.text.length() > 0) ? docCommand.text.charAt(0) : ' ';
    if (docCommand.offset - 1 >= 0) {
      beforeLastChar=doc.getChar(docCommand.offset - 1);
    }
    if (docCommand.length > 0 && docCommand.text.length() == 0) {
      firstCommandChar='\b';
    }
switch (firstCommandChar) {
case '\b':
      handleDelete(doc,docCommand);
    return;
case '!':
  if (doc.getChar(docCommand.offset - 1) == '<' && doc.getLength() > docCommand.offset + 1 && doc.getChar(docCommand.offset + 1) == '>') {
    handleHTMLComment(doc,docCommand);
  }
return;
case '>':
if (!this.autoInsert_CloseTags) {
if (doc.getLength() > docCommand.offset && doc.getChar(docCommand.offset + 1) == '>') 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) {
super.customizeDocumentCommand(doc,docCommand);
return;
}
break;
}
if (isEnterInTag(doc,docCommand)) {
handleEnterInTag(doc,docCommand);
}
 else {
String prevLineWhitespace=getPrevLineWhiteSpace(doc,docCommand.offset);
docCommand.text+=prevLineWhitespace;
}
}
 catch (BadLocationException ex) {
System.err.println("String_Node_Str");
ex.printStackTrace();
return;
}
catch (Exception e) {
e.printStackTrace();
}
}