Buggy code:
TableColumn [ ] columns ; TableItem currentItem ; TableColumn sortColumn ; GC paintGC ; int clickCount ; int sortDirection ; int itemCount ; int columnCount ; int column_id ; int idCount ; int anchorFirst ; int anchorLast ; int headerHeight ; int lastIndexOf ; boolean ignoreSelect ; boolean wasSelected ; boolean fixScrollWidth ; Rectangle imageBounds ; int showIndex ; int lastHittest ; static final int CHECK_COLUMN_ID = 1024 ; static final int COLUMN_ID = 1025 ; static final int GRID_WIDTH = 1 ; static final int ICON_AND_TEXT_GAP = 4 ; static final int CELL_CONTENT_INSET = 12 ; public Table ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } TableItem _getItem ( int index ) { } int callPaintEventHandler ( int control , int damageRgn , int visibleRgn , int theEvent , int nextHandler ) { } boolean checkData ( TableItem item , boolean redraw ) { } void checkItems ( boolean setScrollWidth ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public void clear ( int index ) { } public void clear ( int start , int end ) { } public void clear ( int [ ] indices ) { } public void clearAll ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { } void createItem ( TableColumn column , int index ) { if ( ! ( ( 0 <= index ) && ( index <= ( columnCount ) ) ) ) error ( ERROR_INVALID_RANGE ) ; column . id = ( column_id ) + ( ( idCount ) ++ ) ; int position = index + ( ( ( style ) & ( SWT . CHECK ) ) != 0 ? 1 : 0 ) ; if ( ( columnCount ) != 0 ) { DataBrowserListViewColumnDesc desc = new DataBrowserListViewColumnDesc ( ) ; desc . headerBtnDesc_version = OS . kDataBrowserListViewLatestHeaderDesc ; desc . propertyDesc_propertyID = column . id ; desc . propertyDesc_propertyType = OS . kDataBrowserCustomType ; desc . propertyDesc_propertyFlags = ( ( OS . kDataBrowserListViewSelectionColumn ) | ( OS . kDataBrowserDefaultPropertyFlags ) ) | ( OS . kDataBrowserListViewSortableColumn ) ; desc . headerBtnDesc_maximumWidth = 32767 ; desc . headerBtnDesc_initialOrder = OS . kDataBrowserOrderIncreasing ; desc . headerBtnDesc_btnFontStyle_just = OS . teFlushLeft ; if ( ( ( style ) & ( SWT . CENTER ) ) != 0 ) desc . headerBtnDesc_btnFontStyle_just = OS . teCenter ; if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) desc . headerBtnDesc_btnFontStyle_just = OS . teFlushRight ; desc . headerBtnDesc_btnFontStyle_flags |= OS . kControlUseJustMask ; OS . AddDataBrowserListViewColumn ( handle , desc , position ) ; OS . SetDataBrowserTableViewNamedColumnWidth ( handle , column . id , ( ( short ) ( 0 ) ) ) ; } if ( ( columnCount ) == ( columns . length ) ) { TableColumn [ ] newColumns = new TableColumn [ ( columnCount ) + 4 ] ; System . arraycopy ( columns , 0 , newColumns , 0 , columns . length ) ; columns = newColumns ; } System . arraycopy ( columns , index , columns , ( index + 1 ) , ( ( ( columnCount ) ++ ) - index ) ) ; columns [ index ] = column ; <START_BUG> if ( ( columnCount ) >= 1 ) { <END_BUG> for ( int i = 0 ; i < ( itemCount ) ; i ++ ) { TableItem item = items [ i ] ; if ( item != null ) { String [ ] strings = item . strings ; if ( strings != null ) { String [ ] temp = new String [ columnCount ] ; System . arraycopy ( strings , 0 , temp , 0 , index ) ; System . arraycopy ( strings , index , temp , ( index + 1 ) , ( ( ( columnCount ) - index ) - 1 ) ) ; temp [ index ] = "" ; item . strings = temp ; } if ( index == 0 ) item . text = "" ; Image [ ] images = item . images ; if ( images != null ) { Image [ ] temp = new Image [ columnCount ] ; System . arraycopy ( images , 0 , temp , 0 , index ) ; System . arraycopy ( images , index , temp , ( index + 1 ) , ( ( ( columnCount ) - index ) - 1 ) ) ; item . images = temp ; } if ( index == 0 ) item . image = null ; Color [ ] cellBackground = item . cellBackground ; if ( cellBackground != null ) { Color [ ] temp = new Color [ columnCount ] ; System . arraycopy ( cellBackground , 0 , temp , 0 , index ) ; System . arraycopy ( cellBackground , index , temp , ( index + 1 ) , ( ( ( columnCount ) - index ) - 1 ) ) ; item . cellBackground = temp ; } Color [ ] cellForeground = item . cellForeground ; if ( cellForeground != null ) { Color [ ] temp = new Color [ columnCount ] ; System . arraycopy ( cellForeground , 0 , temp , 0 , index ) ; System . arraycopy ( cellForeground , index , temp , ( index + 1 ) , ( ( ( columnCount ) - index ) - 1 ) ) ; item . cellForeground = temp ; } Font [ ] cellFont = item . cellFont ;

Fix:
if ( ( columnCount ) > 1 ) {