Buggy code:
public TreeItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } int getSelectionIndex ( TreeItem item ) { } public TreeColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public TreeItem getTopItem ( ) { } Image getUncheckedImage ( ) { } void handleEvents ( Event event ) { } String headerGetToolTip ( int x ) { } void headerHideToolTip ( ) { } void headerOnMouseDoubleClick ( Event event ) { } void headerOnMouseDown ( Event event ) { } void headerOnMouseExit ( ) { } void headerOnMouseHover ( Event event ) { } void headerOnMouseMove ( Event event ) { } void headerOnMouseUp ( Event event ) { } void headerOnPaint ( Event event ) { } void headerPaintHShadows ( GC gc , int x , int y , int width , int height ) { } void headerPaintVShadows ( GC gc , int x , int y , int width , int height ) { } void headerShowToolTip ( int x ) { } boolean headerUpdateToolTip ( int x ) { } public int indexOf ( TreeColumn column ) { } public int indexOf ( TreeItem item ) { } static void initImages ( final Display display ) { } void makeAvailable ( TreeItem item ) { } void makeDescendentsAvailable ( TreeItem item , TreeItem [ ] descendents ) { } void makeDescendentsUnavailable ( TreeItem item , TreeItem [ ] descendents ) { } void onArrowDown ( int stateMask ) { } void onArrowLeft ( int stateMask ) { } void onArrowRight ( int stateMask ) { } void onArrowUp ( int stateMask ) { } void onCR ( ) { } void onDispose ( Event event ) { } void onEnd ( int stateMask ) { } void onFocusIn ( ) { } void onFocusOut ( ) { } void onHome ( int stateMask ) { } void onKeyDown ( Event event ) { } void onMouseDoubleClick ( Event event ) { } void onMouseDown ( Event event ) { } void onMouseUp ( Event event ) { } void onPageDown ( int stateMask ) { } void onPageUp ( int stateMask ) { } void onPaint ( Event event ) { } void onResize ( Event event ) { } void onScrollHorizontal ( Event event ) { } void onScrollVertical ( Event event ) { } void onSpace ( ) { } void reassignFocus ( ) { } public void redraw ( ) { } public void redraw ( int x , int y , int width , int height , boolean all ) { } void redrawFromItemDownwards ( int index ) { } void redrawItem ( int itemIndex , boolean focusBoundsOnly ) { } void redrawItems ( int startIndex , int endIndex , boolean focusBoundsOnly ) { } public void removeAll ( ) { } void removeSelectedItem ( int index ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeTreeListener ( TreeListener listener ) { } public void selectAll ( ) { } void selectItem ( TreeItem item , boolean addToSelection ) { } public void setColumnOrder ( int [ ] order ) { } void setFocusItem ( TreeItem item , boolean redrawOldFocus ) { } public void setFont ( Font value ) { } void setHeaderImageHeight ( int value ) { } public void setHeaderVisible ( boolean value ) { } void setImageHeight ( int value ) { } public void setInsertMark ( TreeItem item , boolean before ) { } public void setItemCount ( int count ) { } public void setLinesVisible ( boolean value ) { } public void setRedraw ( boolean value ) { } 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 ) { } public void showSelection ( ) { } void updateColumnWidth ( TreeColumn column , int width ) { } void updateHorizontalBar ( ) { if ( ( drawCount ) != 0 ) return ; ScrollBar hBar = getHorizontalBar ( ) ; int maxX = 0 ; if ( ( columns . length ) > 0 ) { for ( int i = 0 ; i < ( columns . length ) ; i ++ ) { maxX += columns [ i ] . width ; } } else { for ( int i = 0 ; i < ( availableItemsCount ) ; i ++ ) { <START_BUG> Rectangle itemBounds = availableItems [ i ] . getPaintBounds ( false ) ; <END_BUG> maxX = Math . max ( maxX , ( ( ( itemBounds . x ) + ( itemBounds . width ) ) + ( horizontalOffset ) ) ) ; } } int clientWidth = getClientArea ( ) . width ; if ( maxX != ( hBar . getMaximum ( ) ) ) { hBar . setMaximum ( maxX ) ; } int thumb = Math . min ( clientWidth , maxX ) ; if ( thumb != ( hBar . getThumb ( ) ) ) { hBar . setThumb ( thumb ) ; hBar . setPageIncrement ( thumb ) ; } hBar . setVisible ( ( clientWidth < maxX ) ) ; if ( maxX < ( ( horizontalOffset ) + thumb ) ) { horizontalOffset = maxX - thumb ; hBar . setSelection ( horizontalOffset ) ; redraw ( ) ; } else { int selection = hBar . getSelection ( ) ; if ( selection != ( horizontalOffset ) ) { horizontalOffset = selection ; redraw ( ) ; } } } void updateHorizontalBar ( int newRightX , int rightXchange ) { } void updateVerticalBar ( ) { } }

Fix:
Rectangle itemBounds = availableItems [ i ] . getCellBounds ( 0 ) ;