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 ) ) ; NSSize size = cell . cellSize ( ) ; <START_BUG> width = ( ( int ) ( Math . ceil ( 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 ) ) ) ; NSRect 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 , false , false ) ; } width = event . width ; } } if ( columnIndex == 0 ) { NSTableColumn column = ( ( parent . columnCount ) == 0 ) ? parent . firstColumn : parent . columns [ 0 ] . nsColumn ; NSOutlineView outlineView = ( ( NSOutlineView ) ( parent . view ) ) ; int rowIndex = ( ( int ) ( outlineView . rowForItem ( handle ) ) ) ; int nsColumnIndex = ( ( int ) ( outlineView . columnWithIdentifier ( column ) ) ) ; NSRect columnRect = outlineView . rectOfColumn ( nsColumnIndex ) ; NSRect cellRect = outlineView . frameOfCellAtColumn ( nsColumnIndex , rowIndex ) ; width += ( cellRect . x ) - ( columnRect . x ) ; } 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 ) { }

Fix:
width = ( ( int ) ( 0.5F + ( size . width ) ) ) ;