Buggy code:
int drawItemProc ( int browser , int id , int property , int itemState , int theRect , int gdDepth , int colorDevice ) { } void enableWidget ( boolean enabled ) { } void fixScrollBar ( ) { } String [ ] getAxAttributes ( ) { } public int getBorderWidth ( ) { } int getCheckColumnWidth ( ) { } public Rectangle getClientArea ( ) { } public TreeColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TreeColumn [ ] getColumns ( ) { } int getGap ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } int getLeftDisclosureInset ( int column_id ) { } int getInsetWidth ( int column_id , boolean leftInset ) { } public TreeItem getItem ( int index ) { } public TreeItem getItem ( Point point ) { } public int getItemCount ( ) { } int getItemCount ( TreeItem parentItem ) { } public int getItemHeight ( ) { } public TreeItem [ ] getItems ( ) { } TreeItem [ ] getItems ( TreeItem parentItem ) { } public boolean getLinesVisible ( ) { } public TreeItem getParentItem ( ) { } public TreeItem [ ] getSelection ( ) { } int getSelection ( TreeItem [ ] result , int item , int ptr , int index ) { } public int getSelectionCount ( ) { } public TreeColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public TreeItem getTopItem ( ) { } int helpProc ( int inControl , int inGlobalMouse , int inRequest , int outContentProvided , int ioHelpContent ) { } int hitTestProc ( int browser , int id , int property , int theRect , int mouseRect ) { } void hookEvents ( ) { } public int indexOf ( TreeColumn column ) { } public int indexOf ( TreeItem item ) { } int _indexOf ( TreeItem parentItem , TreeItem item ) { } int itemCompareProc ( int browser , int itemOne , int itemTwo , int sortProperty ) { } int itemDataProc ( int browser , int id , int property , int itemData , int setValue ) { } int itemNotificationProc ( int browser , int id , int message ) { } int kEventAccessibleGetNamedAttribute ( int nextHandler , int theEvent , int userData ) { } int kEventControlGetClickActivation ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetCursor ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } void releaseItem ( TreeItem item , boolean release ) { } void releaseItems ( int [ ] ids ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeTreeListener ( TreeListener listener ) { } void resetVisibleRegion ( int control ) { } public void setInsertMark ( TreeItem item , boolean before ) { } public void selectAll ( ) { } public void select ( TreeItem item ) { checkWidget ( ) ; if ( item == null ) error ( ERROR_NULL_ARGUMENT ) ; if ( item . isDisposed ( ) ) error ( ERROR_INVALID_ARGUMENT ) ; showItem ( item , false ) ; ignoreSelect = true ; int [ ] selectionFlags = null ; if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { selectionFlags = new int [ 1 ] ; OS . GetDataBrowserSelectionFlags ( handle , selectionFlags ) ; OS . SetDataBrowserSelectionFlags ( handle , ( ( selectionFlags [ 0 ] ) & ( ~ ( OS . kDataBrowserNeverEmptySelectionSet ) ) ) ) ; } <START_BUG> OS . SetDataBrowserSelectedItems ( handle , 1 , new int [ ] { item . id } , kDataBrowserItemsAssign ) ; <END_BUG> if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { OS . SetDataBrowserSelectionFlags ( handle , selectionFlags [ 0 ] ) ; } ignoreSelect = false ; } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setColumnOrder ( int [ ] order ) { } void setFontStyle ( Font font ) { } public void setHeaderVisible ( boolean show ) { } public void setItemCount ( int count ) { } void setItemCount ( TreeItem parentItem , int count ) { } void setItemHeight ( int itemHeight ) { } void setItemHeight ( Image image ) { } public void setLinesVisible ( boolean show ) { } public void setRedraw ( boolean redraw ) { } boolean setScrollWidth ( TreeItem item ) { } boolean setScrollBarVisible ( ScrollBar bar , boolean visible ) { } boolean setScrollWidth ( boolean set ) { } boolean setScrollWidth ( boolean set , int [ ] childIds , boolean recurse ) { } public void setSelection ( TreeItem item ) { } public void setSelection ( TreeItem [ ] items ) { } public void setSortColumn ( TreeColumn column ) { } public void setSortDirection ( int direction ) { } public void setTopItem ( TreeItem item ) { } public void showColumn ( TreeColumn column ) { } public void showItem ( TreeItem item ) { } void showItem ( TreeItem item , boolean scroll ) { } public void showSelection ( ) { } int trackingProc ( int browser , int id , int property , int theRect , int startPt , int modifiers ) { } }

Fix:
OS . SetDataBrowserSelectedItems ( handle , 1 , new int [ ] { item . id } , ( ( ( style ) & ( SWT . MULTI ) ) != 0 ? OS . kDataBrowserItemsAdd : OS . kDataBrowserItemsAssign ) ) ;