Buggy code:
imageBounds = image . getBounds ( ) ; contentWidth += ( this . imageBounds . width ) + gap ; } int paintWidth = contentWidth ; if ( hooks ( MeasureItem ) ) { Event event = new Event ( ) ; event . item = item ; event . index = columnIndex ; event . gc = gc ; event . width = contentWidth ; event . height = itemHeight ; sendEvent ( MeasureItem , event ) ; if ( ( this . itemHeight ) < ( event . height ) ) { this . itemHeight = event . height ; OS . SetDataBrowserTableViewRowHeight ( handle , ( ( short ) ( event . height ) ) ) ; redrawWidget ( handle , false ) ; } if ( setScrollWidth ( item ) ) { redrawWidget ( handle , false ) ; } contentWidth = event . width ; itemHeight = event . height ; gc . setClipping ( region ) ; gc . setFont ( font ) ; } int drawState = SWT . FOREGROUND ; if ( ( ( item . background ) != null ) || ( ( ( item . cellBackground ) != null ) && ( ( item . cellBackground [ columnIndex ] ) != null ) ) ) drawState |= SWT . BACKGROUND ; if ( ( itemState & ( ( OS . kDataBrowserItemIsSelected ) | ( OS . kDataBrowserItemIsDragTarget ) ) ) != 0 ) drawState |= SWT . SELECTED ; boolean wasSelected = ( drawState & ( SWT . SELECTED ) ) != 0 ; if ( ( ( drawState & ( SWT . SELECTED ) ) != 0 ) && ( ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) || ( columnIndex == 0 ) ) ) { gc . setBackground ( display . getSystemColor ( COLOR_LIST_SELECTION ) ) ; gc . setForeground ( display . getSystemColor ( COLOR_LIST_SELECTION_TEXT ) ) ; } else { gc . setBackground ( background ) ; gc . setForeground ( foreground ) ; } if ( hooks ( EraseItem ) ) { Event event = new Event ( ) ; event . item = item ; event . index = columnIndex ; event . gc = gc ; event . x = itemX ; event . y = itemY ; event . width = itemWidth ; event . height = itemHeight ; event . detail = drawState ; sendEvent ( EraseItem , event ) ; drawState = ( event . doit ) ? event . detail : 0 ; gc . setClipping ( region ) ; gc . setFont ( font ) ; if ( ( ( drawState & ( SWT . SELECTED ) ) != 0 ) && ( ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) || ( columnIndex == 0 ) ) ) { gc . setBackground ( display . getSystemColor ( COLOR_LIST_SELECTION ) ) ; gc . setForeground ( display . getSystemColor ( COLOR_LIST_SELECTION_TEXT ) ) ; } else { gc . setBackground ( background ) ; if ( ! wasSelected ) gc . setForeground ( foreground ) ; } } <START_BUG> if ( ( columnCount ) != 0 ) { <END_BUG> TreeColumn column = columns [ columnIndex ] ; if ( ( ( column . style ) & ( SWT . CENTER ) ) != 0 ) x += ( width - contentWidth ) // 2 ; if ( ( ( column . style ) & ( SWT . RIGHT ) ) != 0 ) x += width - contentWidth ; } int stringX = x ; if ( image != null ) stringX += ( this . imageBounds . width ) + gap ; if ( ( ( drawState & ( SWT . SELECTED ) ) != 0 ) && ( ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) || ( columnIndex == 0 ) ) ) { if ( ( ( ( style ) & ( SWT . HIDE_SELECTION ) ) == 0 ) || ( hasFocus ( ) ) ) { if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { gc . fillRectangle ( itemX , itemY , itemWidth , ( itemHeight - 1 ) ) ; drawState &= ~ ( SWT . BACKGROUND ) ; } else if ( columnIndex == 0 ) { gc . fillRectangle ( ( stringX - 1 ) , y , ( ( extent . x ) + 2 ) , ( itemHeight - 1 ) ) ; drawState &= ~ ( SWT . BACKGROUND ) ; } } else { if ( ( drawState & ( SWT . BACKGROUND ) ) != 0 ) gc . setBackground ( background ) ; } } if ( ( drawState & ( SWT . BACKGROUND ) ) != 0 ) { if ( ( columnCount ) == 0 ) { gc . fillRectangle ( ( stringX - 1 ) , y , ( ( extent . x ) + 2 ) , ( itemHeight - 1 ) ) ; } else { gc . fillRectangle ( itemX , itemY , itemWidth , itemHeight ) ; } } if ( ( drawState & ( SWT . FOREGROUND ) ) != 0 ) { if ( image != null ) { int imageX = x ; int imageY = y + ( ( height - ( this . imageBounds . height ) ) // 2 ) ; gc . drawImage ( image , 0 , 0 , imageBounds . width , imageBounds . height , imageX , imageY , this . imageBounds . width , this . imageBounds . height ) ; } gc . drawString ( text , stringX , ( y + ( ( height - ( extent . y ) ) // 2 ) ) , true ) ;

Fix:
if ( ( ( columnCount ) != 0 ) && ( columnIndex != 0 ) ) {