Buggy code:
Rectangle clipping = gc . getClipping ( ) ; int headerHeight = getHeaderHeight ( ) ; int numColumns = orderedColumns . length ; int startColumn = - 1 ; int endColumn = - 1 ; if ( numColumns > 0 ) { startColumn = computeColumnIntersect ( clipping . x , 0 ) ; if ( startColumn != ( - 1 ) ) { endColumn = computeColumnIntersect ( ( ( clipping . x ) + ( clipping . width ) ) , startColumn ) ; if ( endColumn == ( - 1 ) ) endColumn = numColumns - 1 ; } } else { startColumn = endColumn = 0 ; } int startIndex = ( ( ( clipping . y ) - headerHeight ) // ( itemHeight ) ) + ( topIndex ) ; int endIndex = - 1 ; if ( startIndex < ( itemsCount ) ) { endIndex = startIndex + ( Compatibility . ceil ( clipping . height , itemHeight ) ) ; } startIndex = Math . max ( 0 , startIndex ) ; endIndex = Math . min ( endIndex , ( ( itemsCount ) - 1 ) ) ; int current = 0 ; for ( int i = startIndex ; i <= endIndex ; i ++ ) { TableItem item = items [ i ] ; if ( startColumn == ( - 1 ) ) { item . paint ( gc , null , false ) ; } else { if ( numColumns == 0 ) { item . paint ( gc , null , true ) ; } else { for ( int j = startColumn ; j <= endColumn ; j ++ ) { item . paint ( gc , orderedColumns [ j ] , true ) ; } } } if ( isFocusControl ( ) ) { if ( ( focusItem ) == item ) { Rectangle focusBounds = item . getFocusBounds ( ) ; if ( ( focusBounds . width ) > 0 ) { gc . setClipping ( focusBounds ) ; int [ ] oldLineDash = gc . getLineDash ( ) ; if ( item . isSelected ( ) ) { gc . setLineDash ( new int [ ] { 2 , 2 } ) ; } else { gc . setLineDash ( new int [ ] { 1 , 1 } ) ; } gc . drawFocus ( focusBounds . x , focusBounds . y , focusBounds . width , focusBounds . height ) ; gc . setLineDash ( oldLineDash ) ; } } } } gc . setBackground ( getBackground ( ) ) ; gc . setClipping ( clipping ) ; Rectangle clientArea = getClientArea ( ) ; int bottomY = ( endIndex >= 0 ) ? ( getItemY ( items [ endIndex ] ) ) + ( itemHeight ) : 0 ; int fillHeight = Math . max ( 0 , ( ( clientArea . height ) - bottomY ) ) ; if ( fillHeight > 0 ) { gc . fillRectangle ( 0 , bottomY , clientArea . width , fillHeight ) ; } if ( ( columns . length ) > 0 ) { TableColumn [ ] orderedColums = getOrderedColumns ( ) ; TableColumn column = orderedColums [ ( ( orderedColums . length ) - 1 ) ] ; int rightX = ( column . getX ( ) ) + ( column . width ) ; if ( rightX < ( clientArea . width ) ) { gc . fillRectangle ( rightX , 0 , ( ( clientArea . width ) - rightX ) , ( ( clientArea . height ) - fillHeight ) ) ; } } if ( linesVisible ) { gc . setForeground ( display . getSystemColor ( COLOR_WIDGET_LIGHT_SHADOW ) ) ; if ( ( numColumns > 0 ) && ( startColumn != ( - 1 ) ) ) { for ( int i = startColumn ; i <= endColumn ; i ++ ) { <START_BUG> int x = ( ( columns [ i ] . getX ( ) ) + ( columns [ i ] . width ) ) - 1 ; <END_BUG> gc . drawLine ( x , clipping . y , x , ( ( clipping . y ) + ( clipping . height ) ) ) ; } } bottomY = ( clipping . y ) + ( clipping . height ) ; int rightX = ( clipping . x ) + ( clipping . width ) ; int y = ( ( ( ( clipping . y ) - headerHeight ) // ( itemHeight ) ) * ( itemHeight ) ) + headerHeight ; while ( y <= bottomY ) { gc . drawLine ( clipping . x , y , rightX , y ) ; y += itemHeight ; } } } void onResize ( Event event ) { } void onScrollHorizontal ( Event event ) { } void onScrollVertical ( Event event ) { } void onSpace ( ) { } void reassignFocus ( ) { } public void redraw ( ) { } public void redraw ( int x , int y , int width , int height , boolean all ) { } void redrawFromItemDownwards ( int index ) { } void redrawItem ( int itemIndex , boolean focusBoundsOnly ) { } void redrawItems ( int startIndex , int endIndex , boolean focusBoundsOnly ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } void removeSelectedItem ( int index ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void select ( int index ) { } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } public void selectAll ( ) { }

Fix:
int x = ( ( orderedColumns [ i ] . getX ( ) ) + ( orderedColumns [ i ] . width ) ) - 1 ;