Buggy code:
public abstract class Control extends Widget implements Drawable { public int handle ; Composite parent ; String toolTipText ; Object layoutData ; int drawCount ; int visibleRgn ; Menu menu ; float [ ] foreground ; float [ ] background ; Image backgroundImage ; Font font ; Cursor cursor ; GCData [ ] gcs ; Accessible accessible ; Control ( ) { } public Control ( Composite parent , int style ) { } public void addControlListener ( ControlListener listener ) { } public void addFocusListener ( FocusListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addKeyListener ( KeyListener listener ) { } public void addMouseListener ( MouseListener listener ) { } public void addMouseTrackListener ( MouseTrackListener listener ) { } public void addMouseMoveListener ( MouseMoveListener listener ) { } public void addPaintListener ( PaintListener listener ) { } public void addTraverseListener ( TraverseListener listener ) { } int colorProc ( int inControl , int inMessage , int inDrawDepth , int inDrawInColor ) { } int callFocusEventHandler ( int nextHandler , int theEvent ) { } void checkBackground ( ) { } void checkBuffered ( ) { } public Point computeSize ( int wHint , int hHint ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } Control computeTabGroup ( ) { } Control [ ] computeTabList ( ) { } Control computeTabRoot ( ) { } void createWidget ( ) { } Color defaultBackground ( ) { } Font defaultFont ( ) { } Color defaultForeground ( ) { } int defaultThemeFont ( ) { } void deregister ( ) { } void destroyWidget ( ) { } void drawFocus ( int control , int context , boolean hasFocus , boolean hasBorder , Rect inset ) { } void drawFocusClipped ( int control , boolean hasFocus , boolean hasBorder , float [ ] background , Rect inset ) { } boolean drawFocusRing ( ) { } boolean drawGripper ( int x , int y , int width , int height , boolean vertical ) { } void drawWidget ( int control , int context , int damageRgn , int visibleRgn , int theEvent ) { } void enableWidget ( boolean enabled ) { } void fillBackground ( int control , int context , Rectangle bounds ) { if ( OS . HIVIEW ) { OS . CGContextSaveGState ( context ) ; CGRect rect = new CGRect ( ) ; if ( bounds != null ) { rect . x = bounds . x ; rect . y = bounds . y ; rect . width = bounds . width ; rect . height = bounds . height ; } else { OS . HIViewGetBounds ( control , rect ) ; } Control widget = findBackgroundControl ( ) ; if ( ( widget != null ) && ( ( widget . backgroundImage ) != null ) ) { CGPoint pt = new CGPoint ( ) ; OS . HIViewConvertPoint ( pt , control , widget . handle ) ; OS . CGContextTranslateCTM ( context , ( - ( pt . x ) ) , ( - ( pt . y ) ) ) ; Pattern pattern = new Pattern ( display , widget . backgroundImage ) ; GCData data = new GCData ( ) ; data . device = display ; data . background = widget . getBackgroundColor ( ) . handle ; GC gc = GC . carbon_new ( context , data ) ; gc . setBackgroundPattern ( pattern ) ; <START_BUG> gc . fillRectangle ( ( ( int ) ( rect . x ) ) , ( ( int ) ( rect . y ) ) , ( ( int ) ( rect . width ) ) , ( ( int ) ( rect . height ) ) ) ; <END_BUG> gc . dispose ( ) ; pattern . dispose ( ) ; } else if ( ( widget != null ) && ( ( widget . background ) != null ) ) { int colorspace = OS . CGColorSpaceCreateDeviceRGB ( ) ; OS . CGContextSetFillColorSpace ( context , colorspace ) ; OS . CGContextSetFillColor ( context , widget . background ) ; OS . CGColorSpaceRelease ( colorspace ) ; OS . CGContextFillRect ( context , rect ) ; } else { if ( ( OS . VERSION ) >= 4160 ) { OS . HIThemeSetFill ( kThemeBrushDialogBackgroundActive , 0 , context , kHIThemeOrientationNormal ) ; OS . CGContextFillRect ( context , rect ) ; } else { Rect rect1 = new Rect ( ) ; rect1 . left = ( ( short ) ( rect . x ) ) ; rect1 . top = ( ( short ) ( rect . y ) ) ; rect1 . right = ( ( short ) ( ( rect . x ) + ( rect . width ) ) ) ; rect1 . bottom = ( ( short ) ( ( rect . y ) + ( rect . height ) ) ) ; OS . SetThemeBackground ( ( ( short ) ( kThemeBrushDialogBackgroundActive ) ) , ( ( short ) ( 0 ) ) , true ) ; OS . EraseRect ( rect1 ) ; } } OS . CGContextRestoreGState ( context ) ; } else { Rect rect = new Rect ( ) ; OS . GetControlBounds ( control , rect ) ; if ( OS . HIVIEW ) { rect . right += rect . left ; rect . bottom += rect . top ; rect . left = rect . top = 0 ; } if ( ( background ) != null ) { OS . RGBForeColor ( toRGBColor ( background ) ) ; OS . PaintRect ( rect ) ; } else { OS . SetThemeBackground ( ( ( short ) ( kThemeBrushDialogBackgroundActive ) ) , ( ( short ) ( 0 ) ) , true ) ;

Fix:
gc . fillRectangle ( ( ( int ) ( ( rect . x ) + ( pt . x ) ) ) , ( ( int ) ( ( rect . y ) + ( pt . y ) ) ) , ( ( int ) ( rect . width ) ) , ( ( int ) ( rect . height ) ) ) ;