Buggy code:
int columnIndex = 0 ; int x = 0 ; if ( column != null ) { columnIndex = column . getIndex ( ) ; x = column . getX ( ) ; } int oldAlpha = gc . getAlpha ( ) ; boolean oldAdvanced = gc . getAdvanced ( ) ; int oldAntialias = gc . getAntialias ( ) ; Pattern oldBackgroundPattern = gc . getBackgroundPattern ( ) ; Pattern oldForegroundPattern = gc . getForegroundPattern ( ) ; int oldInterpolation = gc . getInterpolation ( ) ; int oldTextAntialias = gc . getTextAntialias ( ) ; if ( parent . hooks ( MeasureItem ) ) { int contentWidth = getContentWidth ( columnIndex ) ; int contentX = getContentX ( columnIndex ) ; gc . setFont ( getFont ( columnIndex , false ) ) ; Event event = new Event ( ) ; event . item = this ; event . gc = gc ; event . index = columnIndex ; event . x = contentX ; event . y = parent . getItemY ( this ) ; event . width = contentWidth ; event . height = parent . itemHeight ; parent . sendEvent ( MeasureItem , event ) ; event . gc = null ; if ( gc . isDisposed ( ) ) return false ; gc . setAlpha ( oldAlpha ) ; gc . setAntialias ( oldAntialias ) ; gc . setBackgroundPattern ( oldBackgroundPattern ) ; gc . setForegroundPattern ( oldForegroundPattern ) ; gc . setInterpolation ( oldInterpolation ) ; gc . setTextAntialias ( oldTextAntialias ) ; gc . setAdvanced ( oldAdvanced ) ; if ( isDisposed ( ) ) return false ; if ( ( parent . itemHeight ) != ( event . height ) ) { parent . customHeightSet = true ; boolean update = parent . setItemHeight ( ( ( event . height ) + ( 2 * ( parent . getCellPadding ( ) ) ) ) ) ; if ( update ) parent . redraw ( ) ; } if ( ( parent . columns . length ) == 0 ) { int change = ( event . width ) - ( ( customWidth ) != ( - 1 ) ? customWidth : contentWidth ) ; if ( ( ( event . width ) != contentWidth ) || ( ( customWidth ) != ( - 1 ) ) ) customWidth = event . width ; if ( change != 0 ) { parent . updateHorizontalBar ( ( contentX + ( event . width ) ) , change ) ; } } } Rectangle clientArea = parent . clientArea ; if ( ( ( clientArea . x ) + ( clientArea . width ) ) < x ) return false ; Rectangle cellBounds = getCellBounds ( columnIndex ) ; if ( parent . linesVisible ) { ( cellBounds . y ) ++ ; ( cellBounds . height ) -- ; } int cellRightX = 0 ; if ( column != null ) { cellRightX = ( column . getX ( ) ) + ( column . width ) ; } else { cellRightX = ( cellBounds . x ) + ( cellBounds . width ) ; } gc . setClipping ( x , cellBounds . y , ( ( clientArea . width ) - x ) , cellBounds . height ) ; int y = parent . getItemY ( this ) ; int itemHeight = parent . itemHeight ; if ( column == null ) { parent . drawBackground ( gc , 0 , y , clientArea . width , itemHeight ) ; } else { int fillWidth = cellBounds . width ; if ( parent . linesVisible ) fillWidth -- ; parent . drawBackground ( gc , cellBounds . x , cellBounds . y , fillWidth , cellBounds . height ) ; } boolean isSelected = isSelected ( ) ; <START_BUG> boolean isFocusItem = ( parent . focusItem ) == ( this ) ; <END_BUG> boolean drawBackground = true ; boolean drawForeground = true ; boolean drawSelection = isSelected ; boolean drawFocus = isFocusItem ; if ( parent . hooks ( EraseItem ) ) { drawBackground = ( ( background ) != null ) || ( ( ( cellBackgrounds ) != null ) && ( ( cellBackgrounds [ columnIndex ] ) != null ) ) ; gc . setFont ( getFont ( columnIndex , false ) ) ; if ( isSelected && ( ( columnIndex == 0 ) || ( ( ( parent . style ) & ( SWT . FULL_SELECTION ) ) != 0 ) ) ) { gc . setForeground ( display . getSystemColor ( COLOR_LIST_SELECTION_TEXT ) ) ; gc . setBackground ( display . getSystemColor ( COLOR_LIST_SELECTION ) ) ; } else { gc . setForeground ( getForeground ( columnIndex ) ) ; gc . setBackground ( getBackground ( columnIndex ) ) ; } Event event = new Event ( ) ; event . item = this ; event . gc = gc ; event . index = columnIndex ; event . doit = true ; event . detail = SWT . FOREGROUND ; if ( drawBackground ) event . detail |= SWT . BACKGROUND ; if ( isSelected ) event . detail |= SWT . SELECTED ; if ( isFocusItem ) event . detail |= SWT . FOCUSED ; event . x = cellBounds . x ; event . y = cellBounds . y ; event . width = cellBounds . width ; event . height = cellBounds . height ; gc . setClipping ( cellBounds ) ; parent . sendEvent ( EraseItem , event ) ; event . gc = null ; if ( gc . isDisposed ( ) ) return false ; gc . setAlpha ( oldAlpha ) ; gc . setAntialias ( oldAntialias ) ; gc . setBackgroundPattern ( oldBackgroundPattern ) ; gc . setClipping ( cellBounds ) ;

Fix:
boolean isFocusItem = ( ( parent . focusItem ) == ( this ) ) && ( parent . isFocusControl ( ) ) ;