Buggy code:
public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } public TableItem getItem ( int index ) { } public TableItem getItem ( Point point ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public TableItem [ ] getItems ( ) { } public boolean getLinesVisible ( ) { } public TableItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } public int [ ] getSelectionIndices ( ) { } public TableColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public int getTopIndex ( ) { } void highlightSelectionInClipRect ( int id , int sel , int rect ) { } int hitTestForEvent ( int id , int sel , int event , NSRect rect , int controlView ) { } int image ( int id , int sel ) { } NSRect imageRectForBounds ( int id , int sel , NSRect cellFrame ) { } int indexOf ( NSTableColumn column ) { } public int indexOf ( TableColumn column ) { } public int indexOf ( TableItem item ) { } public boolean isSelected ( int index ) { } boolean isTrim ( NSView view ) { } int menuForEvent ( int id , int sel , int theEvent ) { } int nextState ( int id , int sel ) { } int numberOfRowsInTableView ( int id , int sel , int aTableView ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void select ( int index ) { } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } void select ( int [ ] indices , int count , boolean clear ) { } public void selectAll ( ) { } void updateBackground ( ) { } public void setColumnOrder ( int [ ] order ) { } void setFont ( NSFont font ) { } public void setHeaderVisible ( boolean show ) { } void setImage ( int id , int sel , int arg0 ) { } public void setItemCount ( int count ) { checkWidget ( ) ; count = Math . max ( 0 , count ) ; if ( count == ( itemCount ) ) return ; if ( count == ( itemCount ) ) return ; TableItem [ ] children = items ; if ( count < ( itemCount ) ) { for ( int index = count ; index < ( itemCount ) ; index ++ ) { TableItem item = children [ index ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) item . release ( false ) ; } } if ( count > ( itemCount ) ) { if ( ( ( getStyle ( ) ) & ( SWT . VIRTUAL ) ) == 0 ) { for ( int i = itemCount ; i < count ; i ++ ) { new TableItem ( this , SWT . NONE , i , true ) ; } return ; } } int length = Math . max ( 4 , ( ( ( count + 3 ) // 4 ) * 4 ) ) ; TableItem [ ] newItems = new TableItem [ length ] ; if ( children != null ) { <START_BUG> System . arraycopy ( items , 0 , children , 0 , Math . min ( count , itemCount ) ) ; <END_BUG> } children = newItems ; this . items = newItems ; this . itemCount = count ; ( ( NSTableView ) ( view ) ) . noteNumberOfRowsChanged ( ) ; } void setItemHeight ( int itemHeight ) { } void setItemHeight ( Image image , NSFont font , boolean set ) { } public void setRedraw ( boolean redraw ) { } public void setLinesVisible ( boolean show ) { } boolean setScrollWidth ( ) { } boolean setScrollWidth ( TableItem item ) { } boolean setScrollWidth ( TableItem [ ] items , boolean set ) { } public void setSelection ( int index ) { } public void setSelection ( int start , int end ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( TableItem item ) { } public void setSelection ( TableItem [ ] items ) { } void setSmallSize ( ) { } public void setSortColumn ( TableColumn column ) { } public void setSortDirection ( int direction ) { } void setTableEmpty ( ) { } public void setTopIndex ( int index ) { } public void showColumn ( TableColumn column ) { } void showIndex ( int index ) { } public void showItem ( TableItem item ) { } public void showSelection ( ) { } void sendDoubleSelection ( ) { } boolean sendKeyEvent ( NSEvent nsEvent , int type ) { } void tableViewColumnDidMove ( int id , int sel , int aNotification ) { } void tableViewColumnDidResize ( int id , int sel , int aNotification ) { } void tableViewSelectionDidChange ( int id , int sel , int aNotification ) { } void tableView_didClickTableColumn ( int id , int sel , int tableView , int tableColumn ) { } int tableView_objectValueForTableColumn_row ( int id , int sel , int aTableView , int aTableColumn , int rowIndex ) { }

Fix:
System . arraycopy ( items , 0 , newItems , 0 , Math . min ( count , itemCount ) ) ;