Buggy code:
public class TreeItem extends Item { Tree parent ; TreeItem parentItem ; TreeItem [ ] items ; int itemCount ; String [ ] strings ; Image [ ] images ; boolean checked ; boolean grayed ; boolean cached ; boolean expanded ; Color foreground ; Color background ; Color [ ] cellForeground ; Color [ ] cellBackground ; Font font ; Font [ ] cellFont ; int customWidth = - 1 ; SWTTreeItem handle ; public TreeItem ( Tree parent , int style ) { } public TreeItem ( Tree parent , int style , int index ) { } public TreeItem ( TreeItem parentItem , int style ) { } public TreeItem ( TreeItem parentItem , int style , int index ) { } TreeItem ( Tree parent , TreeItem parentItem , int style , int index , boolean create ) { } static TreeItem checkNull ( TreeItem item ) { } static Tree checkNull ( Tree parent ) { } static int checkIndex ( int index ) { } int calculateWidth ( int columnIndex , GC gc , boolean recurse , boolean callMeasureItem ) { int width = 0 ; if ( ( ! callMeasureItem ) && ( ( customWidth ) != ( - 1 ) ) ) { width = customWidth ; } else { NSBrowserCell cell = parent . dataCell ; cell . setFont ( getFont ( columnIndex ) . handle ) ; cell . setTitle ( NSString . stringWith ( getText ( columnIndex ) ) ) ; Image image = getImage ( columnIndex ) ; cell . setImage ( ( image != null ? image . handle : null ) ) ; NSRect rect = new NSRect ( ) ; rect . width = rect . height = Float . MAX_VALUE ; NSSize size = cell . cellSizeForBounds ( rect ) ; <START_BUG> width = ( ( int ) ( size . width ) ) ; <END_BUG> if ( callMeasureItem && ( parent . hooks ( MeasureItem ) ) ) { NSOutlineView outlineView = ( ( NSOutlineView ) ( parent . view ) ) ; int nsColumnIndex = 0 ; if ( ( parent . columnCount ) > 0 ) { nsColumnIndex = outlineView . columnWithIdentifier ( parent . columns [ columnIndex ] . nsColumn ) ; } int rowIndex = ( ( int ) ( outlineView . rowForItem ( handle ) ) ) ; rect = outlineView . frameOfCellAtColumn ( nsColumnIndex , rowIndex ) ; NSRect contentRect = cell . titleRectForBounds ( rect ) ; int rowHeight = ( ( int ) ( outlineView . rowHeight ( ) ) ) ; Event event = new Event ( ) ; event . item = this ; event . index = columnIndex ; event . gc = gc ; event . x = ( ( int ) ( contentRect . x ) ) ; event . y = ( ( int ) ( contentRect . y ) ) ; event . width = width ; event . height = rowHeight ; parent . sendEvent ( MeasureItem , event ) ; if ( rowHeight < ( event . height ) ) { outlineView . setRowHeight ( event . height ) ; } if ( ( parent . columnCount ) == 0 ) { int change = ( event . width ) - ( ( customWidth ) != ( - 1 ) ? customWidth : width ) ; if ( ( ( customWidth ) != ( - 1 ) ) || ( ( event . width ) != width ) ) { customWidth = event . width ; } if ( change != 0 ) parent . setScrollWidth ( this ) ; } width = event . width ; } } if ( recurse && ( expanded ) ) { for ( int i = 0 ; i < ( items . length ) ; i ++ ) { TreeItem item = items [ i ] ; if ( ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) && ( item . cached ) ) { width = Math . max ( width , item . calculateWidth ( columnIndex , gc , recurse , callMeasureItem ) ) ; } } } return width ; } protected void checkSubclass ( ) { } void clear ( ) { } public void clear ( int index , boolean all ) { } public void clearAll ( boolean all ) { } NSAttributedString createString ( int index ) { } void deregister ( ) { } void destroyWidget ( ) { } public Color getBackground ( ) { } public Color getBackground ( int index ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int index ) { } public boolean getChecked ( ) { } public boolean getExpanded ( ) { } public Font getFont ( ) { } public Font getFont ( int index ) { } public Color getForeground ( ) { } public Color getForeground ( int index ) { } public boolean getGrayed ( ) { } public Image getImage ( ) { } public Image getImage ( int index ) { } public Rectangle getImageBounds ( int index ) { } public TreeItem getItem ( int index ) { } public int getItemCount ( ) { } public TreeItem [ ] getItems ( ) { } String getNameText ( ) { } public Tree getParent ( ) { } public TreeItem getParentItem ( ) { } public String getText ( ) { } public String getText ( int index ) { } public Rectangle getTextBounds ( int index ) { } public int indexOf ( TreeItem item ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void removeAll ( ) { }

Fix:
width = ( ( int ) ( Math . ceil ( size . width ) ) ) ;