Buggy code:
public class TreeItem extends Item { public int handle ; Tree parent ; String [ ] strings ; Image [ ] images ; int background = - 1 ; int foreground = - 1 ; int font = - 1 ; int [ ] cellBackground ; int [ ] cellForeground ; int [ ] cellFont ; 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 ) { } static TreeItem checkNull ( TreeItem item ) { } protected void checkSubclass ( ) { } public Color getBackground ( ) { } public Color getBackground ( int index ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int index ) { } RECT getBounds ( int index , boolean getText , boolean getImage , boolean full ) { if ( ( ! getText ) && ( ! getImage ) ) return new RECT ( ) ; int count = 0 ; int hwndHeader = parent . hwndHeader ; if ( hwndHeader != 0 ) { count = OS . SendMessage ( hwndHeader , HDM_GETITEMCOUNT , 0 , 0 ) ; } RECT rect = new RECT ( ) ; if ( index == 0 ) { int hwnd = parent . handle ; rect . left = handle ; if ( ( OS . SendMessage ( hwnd , TVM_GETITEMRECT , 1 , rect ) ) == 0 ) { return new RECT ( ) ; } if ( getImage ) { Point size = parent . getImageSize ( ) ; rect . left -= ( size . x ) + ( Tree . INSET ) ; if ( ! getText ) rect . right = ( rect . left ) + ( size . x ) ; } if ( ( ( getText && full ) && ( hwndHeader != 0 ) ) && ( count != 0 ) ) { RECT headerRect = new RECT ( ) ; if ( ( OS . SendMessage ( hwndHeader , HDM_GETITEMRECT , 0 , headerRect ) ) == 0 ) { return new RECT ( ) ; } rect . right = headerRect . right ; } } else { if ( ! ( ( 0 <= index ) && ( index < count ) ) ) return new RECT ( ) ; RECT headerRect = new RECT ( ) ; if ( ( OS . SendMessage ( hwndHeader , HDM_GETITEMRECT , index , headerRect ) ) == 0 ) { return new RECT ( ) ; } int hwnd = parent . handle ; rect . left = handle ; if ( ( OS . SendMessage ( hwnd , TVM_GETITEMRECT , 0 , rect ) ) == 0 ) { return new RECT ( ) ; } rect . left = headerRect . left ; rect . right = headerRect . right ; <START_BUG> if ( getText != getImage ) { <END_BUG> if ( ( ( images ) != null ) && ( ( images [ index ] ) != null ) ) { Point size = parent . getImageSize ( ) ; if ( getImage ) { rect . right = Math . min ( ( ( rect . left ) + ( size . x ) ) , rect . right ) ; } else { rect . left = Math . min ( ( ( rect . left ) + ( size . x ) ) , rect . right ) ; } } else { if ( getImage ) rect . right = rect . left ; } } } int gridWidth = ( parent . getLinesVisible ( ) ) ? Tree . GRID_WIDTH : 0 ; if ( getText || ( ! getImage ) ) { rect . right = Math . max ( rect . left , ( ( rect . right ) - gridWidth ) ) ; } rect . bottom = Math . max ( rect . top , ( ( rect . bottom ) - gridWidth ) ) ; return rect ; } public boolean getChecked ( ) { } public boolean getExpanded ( ) { } public Font getFont ( ) { } public Font getFont ( int index ) { } public Color getForeground ( ) { } public Color getForeground ( int index ) { } public boolean getGrayed ( ) { } public int getItemCount ( ) { } public TreeItem [ ] getItems ( ) { } public Image getImage ( int index ) { } public Rectangle getImageBounds ( int index ) { } public Tree getParent ( ) { } public TreeItem getParentItem ( ) { } public String getText ( int index ) { } void redraw ( ) { } void redraw ( int column , boolean drawText , boolean drawImage ) { } void releaseChild ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void setBackground ( Color color ) { } public void setBackground ( int index , Color color ) { } public void setChecked ( boolean checked ) { } public void setExpanded ( boolean expanded ) { } public void setFont ( Font font ) { } public void setFont ( int index , Font font ) { } public void setForeground ( Color color ) { } public void setForeground ( int index , Color color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image [ ] images ) { } public void setImage ( int index , Image image ) { } public void setImage ( Image image ) { } public void setText ( String [ ] strings ) { }

Fix:
if ( ( ! getText ) || ( ! getImage ) ) {