Buggy code:
public class Table extends Composite { Canvas header ; TableColumn [ ] columns = new TableColumn [ 0 ] ; TableColumn [ ] orderedColumns ; TableItem [ ] items = new TableItem [ 0 ] ; TableItem [ ] selectedItems = new TableItem [ 0 ] ; TableItem focusItem ; TableItem anchorItem ; TableItem lastClickedItem ; Event lastSelectionEvent ; boolean linesVisible ; boolean ignoreKey ; int itemsCount = 0 ; int topIndex = 0 ; int horizontalOffset = 0 ; int fontHeight = 0 ; int imageHeight = 0 ; int itemHeight = 0 ; int col0ImageWidth = 0 ; int headerImageHeight = 0 ; TableColumn resizeColumn ; int resizeColumnX = - 1 ; int drawCount = 0 ; TableColumn sortColumn ; int sortDirection = SWT . NONE ; Rectangle arrowBounds ; Rectangle checkboxBounds ; static final int MARGIN_IMAGE = 3 ; static final int MARGIN_CELL = 1 ; static final int SIZE_HORIZONTALSCROLL = 5 ; static final int TOLLERANCE_COLUMNRESIZE = 2 ; static final int WIDTH_HEADER_SHADOW = 2 ; static final int WIDTH_CELL_HIGHLIGHT = 1 ; static final String ELLIPSIS = "..." ; static final String ID_UNCHECKED = "UNCHECKED" ; static final String ID_GRAYUNCHECKED = "GRAYUNCHECKED" ; static final String ID_CHECKMARK = "CHECKMARK" ; static final String ID_ARROWUP = "ARROWUP" ; static final String ID_ARROWDOWN = "ARROWDOWN" ; boolean hasFocus ; public boolean isFocusControl ( ) { } public Table ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } boolean checkData ( TableItem item , boolean redraw ) { } static int checkStyle ( int style ) { } public void clear ( int index ) { } public void clear ( int start , int end ) { } public void clear ( int [ ] indices ) { } public void clearAll ( ) { } int computeColumnIntersect ( int x , int startColumn ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createItem ( TableColumn column , int index ) { } void createItem ( TableItem item ) { } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } public void deselectAll ( ) { } void deselectItem ( TableItem item ) { } void destroyItem ( TableColumn column ) { } void destroyItem ( TableItem item ) { } Image getArrowDownImage ( ) { } Image getArrowUpImage ( ) { } int getCellPadding ( ) { } Image getCheckmarkImage ( ) { } public Control [ ] getChildren ( ) { } public TableColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TableColumn [ ] getColumns ( ) { } Image getGrayUncheckedImage ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } int getHeaderPadding ( ) { } public boolean getHeaderVisible ( ) { } public TableItem getItem ( int index ) { } public TableItem getItem ( Point point ) { checkWidget ( ) ; if ( point == null ) error ( ERROR_NULL_ARGUMENT ) ; <START_BUG> int index = ( ( ( point . y ) - ( getHeaderHeight ( ) ) ) // ( itemHeight ) ) - ( topIndex ) ; <END_BUG> if ( ! ( ( 0 <= index ) && ( index < ( itemsCount ) ) ) ) return null ; TableItem result = items [ index ] ; if ( ! ( result . getHitBounds ( ) . contains ( point ) ) ) return null ; return result ; } public int getItemCount ( ) { } public int getItemHeight ( ) { } public TableItem [ ] getItems ( ) { } int getItemY ( TableItem item ) { } public boolean getLinesVisible ( ) { } TableColumn [ ] getOrderedColumns ( ) { } public TableItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } int getSelectionIndex ( TableItem item ) { } public int [ ] getSelectionIndices ( ) { } public TableColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public int getTopIndex ( ) { } Image getUncheckedImage ( ) { } void handleEvents ( Event event ) { } void headerOnMouseDoubleClick ( Event event ) { } void headerOnMouseDown ( Event event ) { } void headerOnMouseExit ( ) { } void headerOnMouseMove ( Event event ) { } void headerOnMouseUp ( Event event ) { } void headerOnPaint ( Event event ) { } void headerPaintHShadows ( GC gc , int x , int y , int width , int height ) { } void headerPaintVShadows ( GC gc , int x , int y , int width , int height ) { } public int indexOf ( TableColumn column ) { } public int indexOf ( TableItem item ) { } static void initImages ( final Display display ) { } public boolean isSelected ( int index ) { } void onArrowDown ( int stateMask ) { } void onArrowLeft ( int stateMask ) { } void onArrowRight ( int stateMask ) { } void onArrowUp ( int stateMask ) { } void onCR ( ) { } void onDispose ( ) { } void onEnd ( int stateMask ) { } void onFocusIn ( ) { } void onFocusOut ( ) { } void onHome ( int stateMask ) { } void onKeyDown ( Event event ) { } void onMouseDoubleClick ( Event event ) { } void onMouseDown ( Event event ) { } void onMouseUp ( Event event ) { } void onPageDown ( int stateMask ) { } void onPageUp ( int stateMask ) { }

Fix:
int index = ( ( ( point . y ) - ( getHeaderHeight ( ) ) ) // ( itemHeight ) ) + ( topIndex ) ;