Buggy code:
TreeItem [ ] items = new TreeItem [ 0 ] ; TreeItem [ ] availableItems = new TreeItem [ 0 ] ; TreeItem [ ] selectedItems = new TreeItem [ 0 ] ; TreeItem focusItem ; TreeItem anchorItem ; TreeItem insertMarkItem ; TreeItem lastClickedItem ; boolean insertMarkPrecedes = false ; boolean linesVisible ; int topIndex = 0 ; int horizontalOffset = 0 ; int fontHeight = 0 ; int imageHeight = 0 ; int itemHeight = 0 ; int col0ImageWidth = 0 ; int headerImageHeight = 0 ; TreeColumn resizeColumn ; int resizeColumnX = - 1 ; boolean inExpand = false ; Rectangle expanderBounds ; Rectangle checkboxBounds ; static final int MARGIN_IMAGE = 3 ; static final int MARGIN_CELL = 1 ; static final int SIZE_HORIZONTALSCROLL = 5 ; static final int TOLLERANCE_COLUMNRESIZE = 2 ; static final int WIDTH_HEADER_SHADOW = 2 ; static final int WIDTH_CELL_HIGHLIGHT = 1 ; static final String ELLIPSIS = "..." ; static final String ID_EXPANDED = "EXPANDED" ; static final String ID_COLLAPSED = "COLLAPSED" ; static final String ID_UNCHECKED = "UNCHECKED" ; static final String ID_GRAYUNCHECKED = "GRAYUNCHECKED" ; static final String ID_CHECKMARK = "CHECKMARK" ; static final String ID_CONNECTOR_COLOR = "CONNECTOR_COLOR" ; public Tree ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addTreeListener ( TreeListener listener ) { } static int checkStyle ( int style ) { } int computeColumnIntersect ( int x , int startColumn ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createItem ( TreeColumn column , int index ) { } void createItem ( TreeItem item , int index ) { } public void deselectAll ( ) { } void destroyItem ( TreeColumn column ) { } void destroyItem ( TreeItem item ) { } TreeItem [ ] getAllItems ( ) { } int getCellPadding ( ) { } Image getCheckmarkImage ( ) { } public Control [ ] getChildren ( ) { } Image getCollapsedImage ( ) { } public TreeColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public TreeColumn [ ] getColumns ( ) { } Color getConnectorColor ( ) { } Image getExpandedImage ( ) { } Image getGrayUncheckedImage ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } int getHeaderPadding ( ) { } public boolean getHeaderVisible ( ) { } public TreeItem getItem ( Point point ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public TreeItem [ ] getItems ( ) { } int getItemY ( TreeItem item ) { } public boolean getLinesVisible ( ) { } public TreeItem getParentItem ( ) { } public TreeItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } int getSelectionIndex ( TreeItem item ) { } public TreeItem getTopItem ( ) { } Image getUncheckedImage ( ) { } void handleEvents ( Event event ) { } void headerOnMouseDown ( Event event ) { if ( ( event . button ) != 1 ) return ; for ( int i = 0 ; i < ( columns . length ) ; i ++ ) { TreeColumn column = columns [ i ] ; int x = ( column . getX ( ) ) + ( column . width ) ; if ( ( Math . abs ( ( x - ( event . x ) ) ) ) <= ( Tree . TOLLERANCE_COLUMNRESIZE ) ) { if ( ! ( column . resizable ) ) return ; resizeColumn = column ; resizeColumnX = x ; return ; } if ( ( event . x ) < x ) { Event newEvent = new Event ( ) ; newEvent . widget = column ; <START_BUG> postEvent ( Selection , newEvent ) ; <END_BUG> return ; } } } void headerOnMouseExit ( ) { } void headerOnMouseMove ( Event event ) { } void headerOnMouseUp ( Event event ) { } void headerOnPaint ( Event event ) { } void headerPaintShadow ( GC gc , Rectangle bounds , boolean paintHLines , boolean paintVLines ) { } int indexOf ( TreeColumn column ) { } 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 ( ) { } 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 ( ) { } 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 ) { }

Fix:
column . postEvent ( Selection , newEvent ) ;