Buggy code:
Point [ ] getHconnectorEndpoints ( ) { } Rectangle getHitBounds ( ) { } public Image getImage ( ) { } public Image getImage ( int columnIndex ) { } public Rectangle getImageBounds ( int columnIndex ) { } int getIndex ( ) { } public int getItemCount ( ) { } public TreeItem [ ] getItems ( ) { } public Tree getParent ( ) { } public TreeItem getParentItem ( ) { } int getPreferredWidth ( int columnIndex ) { } public String getText ( ) { } public String getText ( int columnIndex ) { } int getTextX ( int columnIndex ) { } boolean hasAncestor ( TreeItem item ) { } boolean isAvailable ( ) { } boolean isLastChild ( ) { } boolean isSelected ( ) { } void paint ( GC gc , TreeColumn column , boolean paintCellContent ) { int columnIndex = 0 ; int x = 0 ; if ( column != null ) { columnIndex = column . getIndex ( ) ; x = column . getX ( ) ; } Rectangle clientArea = parent . getClientArea ( ) ; if ( ( ( clientArea . x ) + ( clientArea . width ) ) < x ) return ; Rectangle cellBounds = getCellBounds ( columnIndex ) ; int cellRightX = 0 ; if ( column != null ) { cellRightX = ( ( column . getX ( ) ) + ( column . width ) ) - 1 ; } else { cellRightX = ( ( cellBounds . x ) + ( cellBounds . width ) ) - 1 ; } if ( cellRightX < 0 ) return ; gc . setClipping ( x , cellBounds . y , ( cellRightX - x ) , cellBounds . height ) ; int y = parent . getItemY ( this ) ; int padding = parent . getCellPadding ( ) ; int itemHeight = parent . itemHeight ; Color background = getBackground ( columnIndex ) ; if ( ! ( background . equals ( parent . getBackground ( ) ) ) ) { Color oldBackground = gc . getBackground ( ) ; gc . setBackground ( background ) ; if ( columnIndex == 0 ) { int focusX = getFocusX ( ) ; gc . fillRectangle ( focusX , ( y + 1 ) , ( cellRightX - focusX ) , ( itemHeight - 1 ) ) ; } else { gc . fillRectangle ( cellBounds . x , ( ( cellBounds . y ) + 1 ) , ( ( cellBounds . width ) - 1 ) , ( ( cellBounds . height ) - 1 ) ) ; } gc . setBackground ( oldBackground ) ; } if ( ( isSelected ( ) ) && ( columnIndex == 0 ) ) { Color oldBackground = gc . getBackground ( ) ; gc . setBackground ( parent . selectionBackgroundColor ) ; Rectangle focusBounds = getFocusBounds ( ) ; gc . fillRectangle ( ( ( focusBounds . x ) + 1 ) , ( ( focusBounds . y ) + 1 ) , ( ( focusBounds . width ) - 2 ) , ( ( focusBounds . height ) - 2 ) ) ; gc . setBackground ( oldBackground ) ; } if ( ! paintCellContent ) return ; if ( columnIndex == 0 ) { Rectangle expanderBounds = getExpanderBounds ( ) ; Color oldForeground = gc . getForeground ( ) ; <START_BUG> gc . setForeground ( parent . connectorLineColor ) ; <END_BUG> int lineX = ( expanderBounds . x ) + ( ( expanderBounds . width ) // 2 ) ; int y2 = expanderBounds . y ; if ( ( items . length ) == 0 ) { y2 += ( expanderBounds . height ) // 2 ; } if ( ( ( parentItem ) != null ) || ( ( getIndex ( ) ) != 0 ) ) { gc . drawLine ( lineX , y , lineX , y2 ) ; } if ( ! ( isLastChild ( ) ) ) { if ( ( items . length ) != 0 ) y2 += expanderBounds . height ; gc . drawLine ( lineX , y2 , lineX , ( y + itemHeight ) ) ; } Point [ ] endpoints = getHconnectorEndpoints ( ) ; gc . drawLine ( endpoints [ 0 ] . x , endpoints [ 0 ] . y , ( ( endpoints [ 1 ] . x ) - ( Tree . MARGIN_IMAGE ) ) , endpoints [ 1 ] . y ) ; TreeItem item = parentItem ; while ( item != null ) { if ( ! ( item . isLastChild ( ) ) ) { Rectangle itemExpanderBounds = item . getExpanderBounds ( ) ; lineX = ( itemExpanderBounds . x ) + ( ( itemExpanderBounds . width ) // 2 ) ; gc . drawLine ( lineX , y , lineX , ( y + itemHeight ) ) ; } item = item . parentItem ; } gc . setForeground ( oldForeground ) ; if ( ( items . length ) > 0 ) { Image image = ( expanded ) ? parent . getExpandedImage ( ) : parent . getCollapsedImage ( ) ; gc . drawImage ( image , expanderBounds . x , expanderBounds . y ) ; } if ( ( ( parent . style ) & ( SWT . CHECK ) ) != 0 ) { Image baseImage = ( grayed ) ? parent . getGrayUncheckedImage ( ) : parent . getUncheckedImage ( ) ; Rectangle checkboxBounds = getCheckboxBounds ( ) ; gc . drawImage ( baseImage , checkboxBounds . x , checkboxBounds . y ) ; if ( checked ) { Image checkmarkImage = parent . getCheckmarkImage ( ) ; Rectangle checkmarkBounds = checkmarkImage . getBounds ( ) ;

Fix:
gc . setForeground ( parent . getConnectorColor ( ) ) ;