Buggy code:
LRESULT sendMouseDownEvent ( int type , int button , int msg , int wParam , int lParam ) { } void setBackgroundPixel ( int pixel ) { } void setCheckboxImageListColor ( ) { } void setCheckboxImageList ( int width , int height ) { } void setFocusIndex ( int index ) { } public void setFont ( Font font ) { } void setForegroundPixel ( int pixel ) { } public void setHeaderVisible ( boolean show ) { } public void setItemCount ( int count ) { } void setItemHeight ( ) { } public void setLinesVisible ( boolean show ) { } public void setRedraw ( boolean redraw ) { } boolean setScrollWidth ( TableItem item , boolean force ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( TableItem [ ] items ) { } public void setSelection ( int index ) { } public void setSelection ( int start , int end ) { } void setTableEmpty ( ) { } public void setTopIndex ( int index ) { } public void showColumn ( TableColumn column ) { } void showItem ( int index ) { } public void showItem ( TableItem item ) { } public void showSelection ( ) { } String toolTipText ( NMTTDISPINFO hdr ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_CHAR ( int wParam , int lParam ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETOBJECT ( int wParam , int lParam ) { } LRESULT WM_KEYDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDBLCLK ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONUP ( int wParam , int lParam ) { } LRESULT WM_MOUSEHOVER ( int wParam , int lParam ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { } LRESULT WM_NOTIFY ( int wParam , int lParam ) { NMHDR hdr = new NMHDR ( ) ; OS . MoveMemory ( hdr , lParam , sizeof ) ; int hwndHeader = OS . SendMessage ( handle , LVM_GETHEADER , 0 , 0 ) ; if ( ( hdr . hwndFrom ) == hwndHeader ) { switch ( hdr . code ) { case OS . HDN_BEGINTRACKW : case OS . HDN_BEGINTRACKA : case OS . HDN_DIVIDERDBLCLICKW : case OS . HDN_DIVIDERDBLCLICKA : { NMHEADER phdn = new NMHEADER ( ) ; OS . MoveMemory ( phdn , lParam , NMHEADER . sizeof ) ; TableColumn column = columns [ phdn . iItem ] ; if ( ( column != null ) && ( ! ( column . getResizable ( ) ) ) ) { return LRESULT . ONE ; } break ; } case OS . HDN_ITEMCHANGEDW : case OS . HDN_ITEMCHANGEDA : { int width = OS . SendMessage ( handle , LVM_GETCOLUMNWIDTH , 0 , 0 ) ; if ( ( ( lastWidth ) == 0 ) && ( width > 0 ) ) { int bits = OS . SendMessage ( handle , LVM_GETEXTENDEDLISTVIEWSTYLE , 0 , 0 ) ; if ( ( bits & ( OS . LVS_EX_GRIDLINES ) ) != 0 ) { RECT rect = new RECT ( ) ; OS . GetClientRect ( handle , rect ) ; rect . right = ( rect . left ) + width ; OS . InvalidateRect ( handle , rect , true ) ; } } lastWidth = width ; NMHEADER phdn = new NMHEADER ( ) ; OS . MoveMemory ( phdn , lParam , NMHEADER . sizeof ) ; if ( ( phdn . pitem ) != 0 ) { HDITEM pitem = new HDITEM ( ) ; OS . MoveMemory ( pitem , phdn . pitem , HDITEM . sizeof ) ; if ( ( ( pitem . mask ) & ( OS . HDI_WIDTH ) ) != 0 ) { TableColumn column = columns [ phdn . iItem ] ; if ( column != null ) { column . sendEvent ( Resize ) ; if ( isDisposed ( ) ) return LRESULT . ZERO ; int count = OS . SendMessage ( hwndHeader , HDM_GETITEMCOUNT , 0 , 0 ) ; if ( ( count == 1 ) && ( ( columns [ 0 ] ) == null ) ) count = 0 ; TableColumn [ ] newColumns = new TableColumn [ count ] ; System . arraycopy ( columns , 0 , newColumns , 0 , count ) ; for ( int i = ( phdn . iItem ) + 1 ; i < count ; i ++ ) { <START_BUG> if ( ! ( newColumns [ i ] . isDisposed ( ) ) ) { <END_BUG> newColumns [ i ] . sendEvent ( Move ) ; } } } } } break ; } case OS . HDN_ITEMDBLCLICKW : case OS . HDN_ITEMDBLCLICKA : { NMHEADER phdn = new NMHEADER ( ) ; OS . MoveMemory ( phdn , lParam , NMHEADER . sizeof ) ; TableColumn column = columns [ phdn . iItem ] ; if ( column != null ) { column . postEvent ( DefaultSelection ) ; } break ; } } } return super . WM_NOTIFY ( wParam , lParam ) ; } LRESULT WM_RBUTTONDBLCLK ( int wParam , int lParam ) { } LRESULT WM_RBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_SYSCOLORCHANGE ( int wParam , int lParam ) { } LRESULT WM_VSCROLL ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGED ( int wParam , int lParam ) { } LRESULT wmNotifyChild ( int wParam , int lParam ) { } }

Fix:
if ( ( ( newColumns [ i ] ) != null ) && ( ! ( newColumns [ i ] . isDisposed ( ) ) ) ) {