Buggy code:
public class Composite extends Scrollable { Layout layout ; int font ; WINDOWPOS [ ] lpwp ; Control [ ] tabList ; int layoutCount ; int backgroundMode ; Composite ( ) { } public Composite ( Composite parent , int style ) { } Control [ ] _getChildren ( ) { } Control [ ] _getTabList ( ) { } public void changed ( Control [ ] changed ) { } void checkBuffered ( ) { } protected void checkSubclass ( ) { } Control [ ] computeTabList ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } Composite findDeferredControl ( ) { } Menu [ ] findMenus ( Control control ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixTabList ( Control control ) { } public int getBackgroundMode ( ) { } public Control [ ] getChildren ( ) { } int getChildrenCount ( ) { } public Layout getLayout ( ) { } public Control [ ] getTabList ( ) { } boolean hooksKeys ( ) { } public boolean getLayoutDeferred ( ) { } public boolean isLayoutDeferred ( ) { } public void layout ( ) { } public void layout ( boolean changed ) { } public void layout ( boolean changed , boolean all ) { } public void layout ( Control [ ] changed ) { } void markLayout ( boolean changed , boolean all ) { } Point minimumSize ( int wHint , int hHint , boolean changed ) { } boolean redrawChildren ( ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } void resizeChildren ( ) { } boolean resizeChildren ( boolean defer , WINDOWPOS [ ] pwp ) { } void resizeEmbeddedHandle ( int embeddedHandle , int width , int height ) { } void sendResize ( ) { } public void setBackgroundMode ( int mode ) { } boolean setFixedFocus ( ) { } public boolean setFocus ( ) { } public void setLayout ( Layout layout ) { } public void setLayoutDeferred ( boolean defer ) { } public void setTabList ( Control [ ] tabList ) { } void setResizeChildren ( boolean resize ) { } boolean setTabGroupFocus ( ) { } String toolTipText ( NMTTDISPINFO hdr ) { } boolean translateMnemonic ( Event event , Control control ) { } boolean translateTraversal ( MSG msg ) { } void updateBackgroundColor ( ) { } void updateBackgroundImage ( ) { } void updateBackgroundMode ( ) { } void updateFont ( Font oldFont , Font newFont ) { } void updateLayout ( boolean resize , boolean all ) { } int widgetStyle ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_GETFONT ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_NCPAINT ( int wParam , int lParam ) { } LRESULT WM_PARENTNOTIFY ( int wParam , int lParam ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { <START_BUG> if ( ( ( state ) & ( CANVAS ) ) == 0 ) { <END_BUG> return super . WM_PAINT ( wParam , lParam ) ; } int oldBits = 0 ; int newBits = 0 ; if ( ! ( OS . IsWinCE ) ) { oldBits = OS . GetWindowLong ( handle , GWL_STYLE ) ; newBits = ( oldBits | ( OS . WS_CLIPSIBLINGS ) ) | ( OS . WS_CLIPCHILDREN ) ; if ( newBits != oldBits ) OS . SetWindowLong ( handle , GWL_STYLE , newBits ) ; } PAINTSTRUCT ps = new PAINTSTRUCT ( ) ; if ( hooks ( Paint ) ) { GCData data = new GCData ( ) ; data . ps = ps ; data . hwnd = handle ; GC gc = GC . win32_new ( this , data ) ; int sysRgn = 0 ; if ( ( ( style ) & ( ( SWT . NO_MERGE_PAINTS ) | ( SWT . DOUBLE_BUFFERED ) ) ) != 0 ) { sysRgn = OS . CreateRectRgn ( 0 , 0 , 0 , 0 ) ; if ( ( OS . GetRandomRgn ( gc . handle , sysRgn , SYSRGN ) ) == 1 ) { if ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 4 , 10 ) ) ) { if ( ( ( OS . GetLayout ( gc . handle ) ) & ( OS . LAYOUT_RTL ) ) != 0 ) { int nBytes = OS . GetRegionData ( sysRgn , 0 , null ) ; int [ ] lpRgnData = new int [ nBytes // 4 ] ; OS . GetRegionData ( sysRgn , nBytes , lpRgnData ) ; int newSysRgn = OS . ExtCreateRegion ( new float [ ] { - 1 , 0 , 0 , 1 , 0 , 0 } , nBytes , lpRgnData ) ; OS . DeleteObject ( sysRgn ) ; sysRgn = newSysRgn ; } } if ( OS . IsWinNT ) { POINT pt = new POINT ( ) ; OS . MapWindowPoints ( 0 , handle , pt , 1 ) ; OS . OffsetRgn ( sysRgn , pt . x , pt . y ) ; } } } int width = ( ps . right ) - ( ps . left ) ; int height = ( ps . bottom ) - ( ps . top ) ; if ( ( width != 0 ) && ( height != 0 ) ) { GC paintGC = null ; Image image = null ;

Fix:
if ( ( ( ( state ) & ( CANVAS ) ) == 0 ) || ( ( ( state ) & ( FOREIGN_HANDLE ) ) != 0 ) ) {