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 ; boolean linesVisible ; boolean redraw = true ; 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 ; 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" ; 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 ) { int index = item . index ; if ( ( itemsCount ) == ( items . length ) ) { <START_BUG> int grow = ( redraw ) ? 4 : 1000 ; <END_BUG> TableItem [ ] newItems = new TableItem [ ( items . length ) + grow ] ; System . arraycopy ( items , 0 , newItems , 0 , items . length ) ; items = newItems ; } if ( index != ( itemsCount ) ) { System . arraycopy ( items , index , items , ( index + 1 ) , ( ( itemsCount ) - index ) ) ; } items [ index ] = item ; ( itemsCount ) ++ ; for ( int i = index + 1 ; i < ( itemsCount ) ; i ++ ) { items [ i ] . index = i ; } updateVerticalBar ( ) ; Rectangle bounds = item . getBounds ( ) ; int rightX = ( bounds . x ) + ( bounds . width ) ; updateHorizontalBar ( rightX , rightX ) ; if ( ( item . index ) < ( topIndex ) ) { ( topIndex ) ++ ; getVerticalBar ( ) . setSelection ( topIndex ) ; return ; } redrawFromItemDownwards ( index ) ; } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } public void deselectAll ( ) { } void destroyItem ( TableColumn column ) { } void destroyItem ( TableItem item ) { } 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 ) { } 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 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 headerPaintShadow ( GC gc , Rectangle bounds , boolean paintHLines , boolean paintVLines ) { } 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 ) { }

Fix:
int grow = ( redraw ) ? 4 : Math . max ( 4 , ( ( ( items . length ) * 3 ) // 2 ) ) ;