Buggy code:
public class Tree extends Composite { NSTableColumn firstColumn ; NSTableColumn checkColumn ; NSBrowserCell dataCell ; NSTableHeaderView headerView ; TreeItem [ ] items ; int itemCount ; TreeColumn [ ] columns ; TreeColumn sortColumn ; int columnCount ; int sortDirection ; boolean ignoreExpand ; boolean ignoreSelect ; boolean ignoreRedraw ; boolean reloadPending ; Rectangle imageBounds ; static final int FIRST_COLUMN_MINIMUM_WIDTH = 5 ; public Tree ( Composite parent , int style ) { } void _addListener ( int eventType , Listener listener ) { } TreeItem _getItem ( TreeItem parentItem , int index , boolean create ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addTreeListener ( TreeListener listener ) { } int calculateWidth ( TreeItem [ ] items , int index , GC gc , boolean recurse ) { } boolean checkData ( TreeItem item , boolean redraw ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void checkItems ( ) { } void clear ( TreeItem parentItem , int index , boolean all ) { } void clearAll ( TreeItem parentItem , boolean all ) { } public void clear ( int index , boolean all ) { } public void clearAll ( boolean all ) { } void clearCachedWidth ( TreeItem [ ] items ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createColumn ( TreeItem item , int index ) { } void createHandle ( ) { } void createItem ( TreeColumn column , int index ) { } void createItem ( TreeItem item , TreeItem parentItem , int index ) { } void createWidget ( ) { } Color defaultBackground ( ) { } NSFont defaultNSFont ( ) { } Color defaultForeground ( ) { } public void deselectAll ( ) { } void deregister ( ) { } public void deselect ( TreeItem item ) { } void destroyItem ( TreeColumn column ) { } void destroyItem ( TreeItem item ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawInteriorWithFrame_inView ( int id , int sel , int cellFrame , int view ) { NSRect rect = new NSRect ( ) ; OS . memmove ( rect , cellFrame , sizeof ) ; boolean hooksErase = hooks ( EraseItem ) ; boolean hooksPaint = hooks ( PaintItem ) ; boolean hooksMeasure = hooks ( MeasureItem ) ; NSOutlineView outlineView = ( ( NSOutlineView ) ( this . view ) ) ; NSBrowserCell cell = new NSBrowserCell ( id ) ; NSPoint pt = new NSPoint ( ) ; pt . x = ( rect . x ) + ( ( rect . width ) // 2 ) ; pt . y = ( rect . y ) + ( ( rect . height ) // 2 ) ; int rowIndex = ( ( int ) ( outlineView . rowAtPoint ( pt ) ) ) ; TreeItem item = ( ( TreeItem ) ( display . getWidget ( outlineView . itemAtRow ( rowIndex ) . id ) ) ) ; int nsColumnIndex = 0 ; int columnIndex = 0 ; if ( ( columnCount ) != 0 ) { nsColumnIndex = ( ( int ) ( outlineView . columnAtPoint ( pt ) ) ) ; NSArray nsColumns = outlineView . tableColumns ( ) ; id nsColumn = nsColumns . objectAtIndex ( nsColumnIndex ) ; for ( int i = 0 ; i < ( columnCount ) ; i ++ ) { if ( ( columns [ i ] . nsColumn . id ) == ( nsColumn . id ) ) { <START_BUG> columnIndex = indexOf ( columns [ i ] ) ; <END_BUG> break ; } } } Color background = ( ( item . cellBackground ) != null ) ? item . cellBackground [ columnIndex ] : null ; if ( background == null ) background = item . background ; boolean drawBackground = background != null ; boolean drawForeground = true ; boolean isSelected = outlineView . isRowSelected ( rowIndex ) ; boolean drawSelection = isSelected ; Color selectionBackground = null ; Color selectionForeground = null ; if ( isSelected && ( hooksErase || hooksPaint ) ) { NSColor nsSelectionForeground ; NSColor nsSelectionBackground ; if ( isFocusControl ( ) ) { nsSelectionForeground = NSColor . alternateSelectedControlTextColor ( ) ; } else { nsSelectionForeground = NSColor . selectedControlTextColor ( ) ; } nsSelectionForeground = nsSelectionForeground . colorUsingColorSpace ( NSColorSpace . deviceRGBColorSpace ( ) ) ; nsSelectionBackground = cell . highlightColorInView ( outlineView ) ; nsSelectionBackground = nsSelectionBackground . colorUsingColorSpace ( NSColorSpace . deviceRGBColorSpace ( ) ) ; float [ ] components = new float [ ( ( int ) ( nsSelectionForeground . numberOfComponents ( ) ) ) ] ; nsSelectionForeground . getComponents ( components ) ; selectionForeground = Color . cocoa_new ( display , components ) ; components = new float [ ( ( int ) ( nsSelectionBackground . numberOfComponents ( ) ) ) ] ; nsSelectionBackground . getComponents ( components ) ; selectionBackground = Color . cocoa_new ( display , components ) ; } NSSize contentSize = cell . cellSize ( ) ; NSSize spacing = outlineView . intercellSpacing ( ) ; int contentWidth = ( ( int ) ( Math . ceil ( contentSize . width ) ) ) ; int itemHeight = ( ( int ) ( Math . ceil ( ( ( outlineView . rowHeight ( ) ) + ( spacing . height ) ) ) ) ) ; NSRect cellRect = outlineView . rectOfColumn ( nsColumnIndex ) ; cellRect . y = rect . y ; cellRect . height = ( rect . height ) + ( spacing . height ) ;

Fix:
columnIndex = i ;