Program: 45220
Project: 45220
Buggy source:
/** 
 * Notifies the reader that the current element declaration is over.
 */
public void endElement(String uri,String localName,String qName) throws SAXException {
  if (unknownElement != null) {
    if (qName.equals(unknownElement))     unknownElement=null;
 else     return;
  }
  if (qName.equals(ELEMENT_ROOT)) {
    if (state != STATE_ROOT)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_UNKNOWN;
  }
 else   if (qName.equals(ELEMENT_TABLE)) {
    if (state != STATE_TABLE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_ALTERNATE)) {
    if (state != STATE_TABLE_ALTERNATE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_HIDDEN)) {
    if (state != STATE_HIDDEN)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_FOLDER)) {
    if (state != STATE_FOLDER)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_ARCHIVE)) {
    if (state != STATE_ARCHIVE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_SYMLINK)) {
    if (state != STATE_SYMLINK)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_MARKED)) {
    if (state != STATE_MARKED)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_FILE)) {
    if (state != STATE_FILE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_SHELL)) {
    if (state != STATE_SHELL)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_SHELL_HISTORY)) {
    if (state != STATE_SHELL_HISTORY)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_EDITOR)) {
    if (state != STATE_EDITOR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_LOCATION_BAR)) {
    if (state != STATE_LOCATION_BAR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_STATUS_BAR)) {
    if (state != STATE_STATUS_BAR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_NORMAL)) {
    if (state == STATE_SHELL_NORMAL)     state=STATE_SHELL;
 else     if (state == STATE_SHELL_HISTORY_NORMAL)     state=STATE_SHELL_HISTORY;
 else     if (state == STATE_HIDDEN_NORMAL)     state=STATE_HIDDEN;
 else     if (state == STATE_FOLDER_NORMAL)     state=STATE_FOLDER;
 else     if (state == STATE_ARCHIVE_NORMAL)     state=STATE_ARCHIVE;
 else     if (state == STATE_SYMLINK_NORMAL)     state=STATE_SYMLINK;
 else     if (state == STATE_MARKED_NORMAL)     state=STATE_MARKED;
 else     if (state == STATE_FILE_NORMAL)     state=STATE_FILE;
 else     if (state == STATE_EDITOR_NORMAL)     state=STATE_EDITOR;
 else     if (state == STATE_LOCATION_BAR_NORMAL)     state=STATE_LOCATION_BAR;
 else     if (state == STATE_TABLE_NORMAL)     state=STATE_TABLE;
 else     if (Debug.ON)     traceIllegalClosing(qName);
  }
 else   if (qName.equals(ELEMENT_SELECTED)) {
    if (state == STATE_SHELL_SELECTED)     state=STATE_SHELL;
 else     if (state == STATE_SHELL_HISTORY_SELECTED)     state=STATE_SHELL_HISTORY;
 else     if (state == STATE_HIDDEN_SELECTED)     state=STATE_HIDDEN;
 else     if (state == STATE_FOLDER_SELECTED)     state=STATE_FOLDER;
 else     if (state == STATE_ARCHIVE_SELECTED)     state=STATE_ARCHIVE;
 else     if (state == STATE_SYMLINK_SELECTED)     state=STATE_SYMLINK;
 else     if (state == STATE_MARKED_SELECTED)     state=STATE_MARKED;
 else     if (state == STATE_FILE_SELECTED)     state=STATE_FILE;
 else     if (state == STATE_EDITOR_SELECTED)     state=STATE_EDITOR;
 else     if (state == STATE_LOCATION_BAR_SELECTED)     state=STATE_LOCATION_BAR;
 else     if (state == STATE_TABLE_SELECTED)     state=STATE_TABLE;
 else     if (Debug.ON)     traceIllegalClosing(qName);
  }
}

Fixed version (ground truth):
/** 
 * Notifies the reader that the current element declaration is over.
 */
public void endElement(String uri,String localName,String qName) throws SAXException {
  if (unknownElement != null) {
    if (qName.equals(unknownElement))     unknownElement=null;
 else     return;
  }
  if (qName.equals(ELEMENT_ROOT)) {
    if (state != STATE_ROOT)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_UNKNOWN;
  }
 else   if (qName.equals(ELEMENT_TABLE)) {
    if (state != STATE_TABLE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_ALTERNATE)) {
    if (state != STATE_TABLE_ALTERNATE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_UNMATCHED)) {
    if (state != STATE_TABLE_UNMATCHED)     traceIllegalDeclaration(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_HIDDEN)) {
    if (state != STATE_HIDDEN)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_FOLDER)) {
    if (state != STATE_FOLDER)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_ARCHIVE)) {
    if (state != STATE_ARCHIVE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_SYMLINK)) {
    if (state != STATE_SYMLINK)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_MARKED)) {
    if (state != STATE_MARKED)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_FILE)) {
    if (state != STATE_FILE)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_TABLE;
  }
 else   if (qName.equals(ELEMENT_SHELL)) {
    if (state != STATE_SHELL)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_SHELL_HISTORY)) {
    if (state != STATE_SHELL_HISTORY)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_EDITOR)) {
    if (state != STATE_EDITOR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_LOCATION_BAR)) {
    if (state != STATE_LOCATION_BAR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_STATUS_BAR)) {
    if (state != STATE_STATUS_BAR)     if (Debug.ON)     traceIllegalClosing(qName);
    state=STATE_ROOT;
  }
 else   if (qName.equals(ELEMENT_NORMAL)) {
    if (state == STATE_SHELL_NORMAL)     state=STATE_SHELL;
 else     if (state == STATE_SHELL_HISTORY_NORMAL)     state=STATE_SHELL_HISTORY;
 else     if (state == STATE_HIDDEN_NORMAL)     state=STATE_HIDDEN;
 else     if (state == STATE_FOLDER_NORMAL)     state=STATE_FOLDER;
 else     if (state == STATE_ARCHIVE_NORMAL)     state=STATE_ARCHIVE;
 else     if (state == STATE_SYMLINK_NORMAL)     state=STATE_SYMLINK;
 else     if (state == STATE_MARKED_NORMAL)     state=STATE_MARKED;
 else     if (state == STATE_FILE_NORMAL)     state=STATE_FILE;
 else     if (state == STATE_EDITOR_NORMAL)     state=STATE_EDITOR;
 else     if (state == STATE_LOCATION_BAR_NORMAL)     state=STATE_LOCATION_BAR;
 else     if (state == STATE_TABLE_NORMAL)     state=STATE_TABLE;
 else     if (Debug.ON)     traceIllegalClosing(qName);
  }
 else   if (qName.equals(ELEMENT_SELECTED)) {
    if (state == STATE_SHELL_SELECTED)     state=STATE_SHELL;
 else     if (state == STATE_SHELL_HISTORY_SELECTED)     state=STATE_SHELL_HISTORY;
 else     if (state == STATE_HIDDEN_SELECTED)     state=STATE_HIDDEN;
 else     if (state == STATE_FOLDER_SELECTED)     state=STATE_FOLDER;
 else     if (state == STATE_ARCHIVE_SELECTED)     state=STATE_ARCHIVE;
 else     if (state == STATE_SYMLINK_SELECTED)     state=STATE_SYMLINK;
 else     if (state == STATE_MARKED_SELECTED)     state=STATE_MARKED;
 else     if (state == STATE_FILE_SELECTED)     state=STATE_FILE;
 else     if (state == STATE_EDITOR_SELECTED)     state=STATE_EDITOR;
 else     if (state == STATE_LOCATION_BAR_SELECTED)     state=STATE_LOCATION_BAR;
 else     if (state == STATE_TABLE_SELECTED)     state=STATE_TABLE;
 else     if (Debug.ON)     traceIllegalClosing(qName);
  }
}