Program: 129007
Project: 129007
Buggy source:
/** 
 * Edit a cell.
 * @param currentControl current control before change, if null the first valid cell is edited or focused.
 */
private void editOtherEditor(final Control currentControl){
  int indexColumnStart=-1;
  int itemIndexStart=-1;
  if (currentControl == null) {
    indexColumnStart=0;
    TableViewerCreatorColumnNotModifiable previousModifiedColumn=getModifiedObjectInfo().getPreviousModifiedColumn();
    if (previousModifiedColumn != null) {
      indexColumnStart=previousModifiedColumn.getIndex();
    }
    itemIndexStart=getTable().getSelectionIndex();
    if (itemIndexStart == -1) {
      itemIndexStart=0;
    }
  }
 else {
    boolean controlLostFocusIsTableEditor=false;
    if (tableEditorManager != null) {
      List<TableEditor> tableEditorList=tableEditorManager.getTableEditorList();
      for (      TableEditor editor : tableEditorList) {
        if (editor.getEditor() == currentControl) {
          controlLostFocusIsTableEditor=true;
          indexColumnStart=editor.getColumn();
          itemIndexStart=getTable().indexOf(editor.getItem());
          break;
        }
      }
    }
    if (!controlLostFocusIsTableEditor) {
      for (      TableViewerCreatorColumnNotModifiable column : columns) {
        if (column.getCellEditor() != null && isEqualsOrChildOf(currentControl,column.getCellEditor().getControl())) {
          indexColumnStart=column.getIndex();
          itemIndexStart=getTable().getSelectionIndex();
          break;
        }
      }
    }
  }
  if (indexColumnStart != -1 && itemIndexStart != -1) {
    final int indexColumnStartFinal=indexColumnStart;
    final int itemIndexStartFinal=itemIndexStart;
    controlClicked=null;
    Runnable runnable=new Runnable(){
      public void run(){
        boolean continueRun=(keyPressed == SWT.TRAVERSE_TAB_NEXT || keyPressed == SWT.TRAVERSE_TAB_PREVIOUS || keyPressed == SWT.TRAVERSE_RETURN || keyPressed == SWT.F2);
        if (!continueRun || getTable().isDisposed()) {
          return;
        }
        List<B> inputList=TableViewerCreatorNotModifiable.this.getInputList();
        int currentIndexColumn=indexColumnStartFinal;
        int currentItemIndex=itemIndexStartFinal;
        CellEditor cellEditorToActivate=null;
        Control controlToFocusIn=null;
        boolean found=false;
        boolean firstLoop=true;
        while (true) {
          if (keyPressed == SWT.TRAVERSE_TAB_NEXT || !firstLoop && (keyPressed == SWT.F2 || keyPressed == SWT.TRAVERSE_RETURN)) {
            currentIndexColumn++;
            if (currentIndexColumn >= columns.size()) {
              currentIndexColumn=0;
              currentItemIndex++;
              if (currentItemIndex >= inputList.size()) {
                break;
              }
            }
          }
 else           if (keyPressed == SWT.TRAVERSE_TAB_PREVIOUS) {
            currentIndexColumn--;
            if (currentIndexColumn < 0) {
              currentIndexColumn=columns.size() - 1;
              currentItemIndex--;
              if (currentItemIndex < 0) {
                break;
              }
            }
          }
 else           if (keyPressed == SWT.TRAVERSE_RETURN) {
          }
          TableViewerCreatorColumnNotModifiable tableViewerCreatorColumn=columns.get(currentIndexColumn);
          if (tableViewerCreatorColumn.getTableEditorContent() != null) {
            TableItem tableItem=getTable().getItem(currentItemIndex);
            if (tableEditorManager != null) {
              List<TableEditor> tableEditorList=tableEditorManager.getTableEditorList();
              for (              TableEditor editor : tableEditorList) {
                if (editor.getColumn() == currentIndexColumn && editor.getItem() == tableItem) {
                  controlToFocusIn=editor.getEditor();
                  found=true;
                  break;
                }
              }
            }
          }
 else           if (tableViewerCreatorColumn.getCellEditor() != null) {
            cellEditorToActivate=tableViewerCreatorColumn.getCellEditor();
            found=true;
          }
          firstLoop=false;
          if (found) {
            if (controlToFocusIn != null) {
              getTable().setSelection(currentItemIndex);
              controlToFocusIn.setFocus();
              break;
            }
 else             if (getCellModifier() != null && getCellModifier().canModify(inputList.get(currentItemIndex),getColumns().get(currentIndexColumn).getId()) && cellEditorToActivate != null) {
              TableViewerCreatorNotModifiable.this.getTableViewer().editElement(inputList.get(currentItemIndex),currentIndexColumn);
              break;
            }
 else {
              found=false;
            }
          }
        }
        keyPressed=0;
      }
    }
;
    new AsynchronousThreading(10,false,getTable().getDisplay(),runnable).start();
  }
}

Fixed version (ground truth):
/** 
 * Edit a cell.
 * @param currentControl current control before change, if null the first valid cell is edited or focused.
 */
private void editOtherEditor(final Control currentControl){
  int indexColumnStart=-1;
  int itemIndexStart=-1;
  if (currentControl == null) {
    indexColumnStart=0;
    TableViewerCreatorColumnNotModifiable previousModifiedColumn=getModifiedObjectInfo().getPreviousModifiedColumn();
    if (previousModifiedColumn != null) {
      indexColumnStart=previousModifiedColumn.getIndex();
    }
    itemIndexStart=getTable().getSelectionIndex();
    if (itemIndexStart == -1) {
      itemIndexStart=0;
    }
  }
 else {
    boolean controlLostFocusIsTableEditor=false;
    if (tableEditorManager != null) {
      List<TableEditor> tableEditorList=tableEditorManager.getTableEditorList();
      for (      TableEditor editor : tableEditorList) {
        if (editor.getEditor() == currentControl) {
          controlLostFocusIsTableEditor=true;
          indexColumnStart=editor.getColumn();
          itemIndexStart=getTable().indexOf(editor.getItem());
          break;
        }
      }
    }
    if (!controlLostFocusIsTableEditor) {
      for (      TableViewerCreatorColumnNotModifiable column : columns) {
        if (column.getCellEditor() != null && isEqualsOrChildOf(currentControl,column.getCellEditor().getControl())) {
          indexColumnStart=column.getIndex();
          itemIndexStart=getTable().getSelectionIndex();
          break;
        }
      }
    }
  }
  if (indexColumnStart != -1 && itemIndexStart != -1) {
    final int indexColumnStartFinal=indexColumnStart;
    final int itemIndexStartFinal=itemIndexStart;
    controlClicked=null;
    Runnable runnable=new Runnable(){
      @Override public void run(){
        boolean continueRun=(keyPressed == SWT.TRAVERSE_TAB_NEXT || keyPressed == SWT.TRAVERSE_TAB_PREVIOUS || keyPressed == SWT.TRAVERSE_RETURN || keyPressed == SWT.F2);
        if (!continueRun || getTable().isDisposed()) {
          return;
        }
        List<B> inputList=TableViewerCreatorNotModifiable.this.getInputList();
        int currentIndexColumn=indexColumnStartFinal;
        int currentItemIndex=itemIndexStartFinal;
        CellEditor cellEditorToActivate=null;
        Control controlToFocusIn=null;
        boolean found=false;
        boolean firstLoop=true;
        while (true) {
          if (keyPressed == SWT.TRAVERSE_TAB_NEXT || !firstLoop && (keyPressed == SWT.F2 || keyPressed == SWT.TRAVERSE_RETURN)) {
            currentIndexColumn++;
            if (currentIndexColumn >= columns.size()) {
              currentIndexColumn=0;
              currentItemIndex++;
              if (currentItemIndex >= inputList.size()) {
                break;
              }
            }
          }
 else           if (keyPressed == SWT.TRAVERSE_TAB_PREVIOUS) {
            currentIndexColumn--;
            if (currentIndexColumn < 0) {
              currentIndexColumn=columns.size() - 1;
              currentItemIndex--;
              if (currentItemIndex < 0) {
                break;
              }
            }
          }
 else           if (keyPressed == SWT.TRAVERSE_RETURN) {
          }
          TableViewerCreatorColumnNotModifiable tableViewerCreatorColumn=columns.get(currentIndexColumn);
          if (tableViewerCreatorColumn.getTableEditorContent() != null) {
            TableItem tableItem=getTable().getItem(currentItemIndex);
            if (tableEditorManager != null) {
              List<TableEditor> tableEditorList=tableEditorManager.getTableEditorList();
              for (              TableEditor editor : tableEditorList) {
                if (editor.getColumn() == currentIndexColumn && editor.getItem() == tableItem) {
                  controlToFocusIn=editor.getEditor();
                  found=true;
                  break;
                }
              }
            }
          }
 else           if (tableViewerCreatorColumn.getCellEditor() != null) {
            cellEditorToActivate=tableViewerCreatorColumn.getCellEditor();
            found=true;
          }
          firstLoop=false;
          if (found) {
            if (controlToFocusIn != null) {
              getTable().setSelection(currentItemIndex);
              controlToFocusIn.setFocus();
              break;
            }
 else             if (getCellModifier() != null && getCellModifier().canModify(inputList.get(currentItemIndex),getColumns().get(currentIndexColumn).getId()) && cellEditorToActivate != null) {
              TableViewerCreatorNotModifiable.this.getTableViewer().editElement(inputList.get(currentItemIndex),currentIndexColumn);
              break;
            }
 else {
              found=false;
            }
          }
        }
        keyPressed=0;
      }
    }
;
    new AsynchronousThreading(10,false,getTable().getDisplay(),runnable).start();
  }
}