Buggy code:
public class TreeItem extends Item { Tree parent ; TreeItem parentItem ; TreeItem [ ] items = TreeItem . NO_ITEMS ; int availableIndex = - 1 ; int depth = 0 ; boolean checked ; boolean grayed ; boolean expanded ; String [ ] texts ; int [ ] textWidths = new int [ 1 ] ; int fontHeight ; int [ ] fontHeights ; Image [ ] images ; Color foreground ; Color background ; String [ ] displayTexts ; Color [ ] cellForegrounds ; Color [ ] cellBackgrounds ; Font font ; Font [ ] cellFonts ; static final int INDENT_HIERARCHY = 6 ; static final int MARGIN_TEXT = 3 ; static final TreeItem [ ] NO_ITEMS = new TreeItem [ 0 ] ; 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 ) { } void addColumn ( TreeColumn column ) { } void addItem ( TreeItem item , int index ) { } static Tree checkNull ( Tree tree ) { } static TreeItem checkNull ( TreeItem item ) { } TreeItem [ ] computeAllDescendents ( ) { } int computeAvailableDescendentCount ( ) { } TreeItem [ ] computeAvailableDescendents ( ) { } void computeDisplayText ( int columnIndex , GC gc ) { } void computeDisplayTexts ( GC gc ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } void expandAncestors ( ) { } public Color getBackground ( ) { } public Color getBackground ( int columnIndex ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int columnIndex ) { } Rectangle getCellBounds ( int columnIndex ) { } Rectangle getCheckboxBounds ( ) { } public boolean getChecked ( ) { } int getContentWidth ( int columnIndex ) { } int getContentX ( int columnIndex ) { } String getDisplayText ( int columnIndex ) { } public boolean getExpanded ( ) { } Rectangle getExpanderBounds ( ) { } Rectangle getFocusBounds ( ) { } int getFocusX ( ) { <START_BUG> int result = getContentX ( 0 ) ; <END_BUG> int imageSpace = parent . col0ImageWidth ; if ( imageSpace > 0 ) { result += imageSpace + ( Tree . MARGIN_IMAGE ) ; } return result ; } public Font getFont ( ) { } public Font getFont ( int columnIndex ) { } int getFontHeight ( ) { } int getFontHeight ( int columnIndex ) { } public Color getForeground ( ) { } public Color getForeground ( int columnIndex ) { } public boolean getGrayed ( ) { } 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 ) { } void recomputeTextWidths ( GC gc ) { } void redrawItem ( ) { } void removeColumn ( TreeColumn column , int index ) { } void removeItem ( TreeItem item , int index ) { } public void setBackground ( Color value ) { } public void setBackground ( int columnIndex , Color value ) { } public void setChecked ( boolean value ) { } public void setExpanded ( boolean value ) { } public void setFont ( Font value ) { } public void setFont ( int columnIndex , Font value ) { } public void setForeground ( Color value ) { } public void setForeground ( int columnIndex , Color value ) { } public void setGrayed ( boolean value ) { } public void setImage ( Image value ) { } public void setImage ( Image [ ] value ) { } public void setImage ( int columnIndex , Image value ) { } public void setText ( String value ) { } public void setText ( String [ ] value ) { } public void setText ( int columnIndex , String value ) { } void updateColumnWidth ( TreeColumn column , GC gc ) { } void updateFont ( GC gc ) { } }

Fix:
int result = ( getContentX ( 0 ) ) - 2 ;