Buggy code:
public abstract class Widget { int style ; int state ; Display display ; EventTable eventTable ; Object data ; static final int DISPOSED = 1 << 0 ; static final int CANVAS = 1 << 1 ; static final int KEYED_DATA = 1 << 2 ; static final int DISABLED = 1 << 3 ; static final int HIDDEN = 1 << 4 ; static final int GRAB = 1 << 5 ; static final int MOVED = 1 << 6 ; static final int RESIZED = 1 << 7 ; static final int EXPANDING = 1 << 8 ; static final int IGNORE_WHEEL = 1 << 9 ; static final int LAYOUT_NEEDED = 1 << 10 ; static final int LAYOUT_CHANGED = 1 << 11 ; static final int LAYOUT_CHILD = 1 << 12 ; static final int RELEASED = 1 << 13 ; static final int DISPOSE_SENT = 1 << 14 ; static final int DEFAULT_WIDTH = 64 ; static final int DEFAULT_HEIGHT = 64 ; static final Rect EMPTY_RECT = new Rect ( ) ; Widget ( ) { } public Widget ( Widget parent , int style ) { } int actionProc ( int theControl , int partCode ) { } public void addListener ( int eventType , Listener handler ) { } int callPaintEventHandler ( int control , int damageRgn , int visibleRgn , int theEvent , int nextHandler ) { } public void addDisposeListener ( DisposeListener listener ) { } static int checkBits ( int style , int int0 , int int1 , int int2 , int int3 , int int4 , int int5 ) { } void calculateVisibleRegion ( int control , int visibleRgn , boolean clipChildren ) { } void checkOpen ( ) { } void checkOrientation ( Widget parent ) { } void checkParent ( Widget parent ) { } protected void checkSubclass ( ) { } protected void checkWidget ( ) { } int colorProc ( int inControl , int inMessage , int inDrawDepth , int inDrawInColor ) { } boolean contains ( int shellX , int shellY ) { } int controlProc ( int nextHandler , int theEvent , int userData ) { } int createCIcon ( Image image ) { } void createHandle ( ) { } int createIconRef ( Image image ) { } void createWidget ( ) { } int commandProc ( int nextHandler , int theEvent , int userData ) { } void deregister ( ) { } void destroyWidget ( ) { } void destroyCIcon ( int iconHandle ) { } int drawItemProc ( int browser , int item , int property , int itemState , int theRect , int gdDepth , int colorDevice ) { } public void dispose ( ) { } void drawBackground ( int control , int context ) { } void drawBackground ( int control , int context , float [ ] background ) { <START_BUG> if ( ( OS . HIVIEW ) && ( ( OS . VERSION ) >= 4160 ) ) { <END_BUG> CGRect rect = new CGRect ( ) ; OS . HIViewGetBounds ( control , rect ) ; if ( background != null ) { int colorspace = OS . CGColorSpaceCreateDeviceRGB ( ) ; OS . CGContextSetFillColorSpace ( context , colorspace ) ; OS . CGContextSetFillColor ( context , background ) ; OS . CGColorSpaceRelease ( colorspace ) ; } else { OS . HIThemeSetFill ( kThemeBrushDialogBackgroundActive , 0 , context , kHIThemeOrientationNormal ) ; } OS . CGContextFillRect ( context , rect ) ; } else { Rect rect = new Rect ( ) ; OS . GetControlBounds ( control , rect ) ; if ( background != null ) { OS . RGBForeColor ( toRGBColor ( background ) ) ; OS . PaintRect ( rect ) ; } else { OS . SetThemeBackground ( ( ( short ) ( kThemeBrushDialogBackgroundActive ) ) , ( ( short ) ( 0 ) ) , true ) ; OS . EraseRect ( rect ) ; } } } void drawFocus ( int control , int context , boolean hasFocus , boolean hasBorder , float [ ] background , Rect inset ) { } void drawFocusClipped ( int control , boolean hasFocus , boolean hasBorder , float [ ] background , Rect inset ) { } void drawWidget ( int control , int context , int damageRgn , int visibleRgn , int theEvent ) { } void error ( int code ) { } boolean filters ( int eventType ) { } int fixMnemonic ( char [ ] buffer ) { } Rectangle getControlBounds ( int control ) { } Point getControlSize ( int control ) { } public Object getData ( ) { } public Object getData ( String key ) { } public Display getDisplay ( ) { } int getDrawCount ( int control ) { } Rect getInset ( ) { } String getName ( ) { } String getNameText ( ) { } public int getStyle ( ) { } int getVisibleRegion ( int control , boolean clipChildren ) { } int helpProc ( int inControl , int inGlobalMouse , int inRequest , int outContentProvided , int ioHelpContent ) { } int hitTestProc ( int browser , int item , int property , int theRect , int mouseRect ) { } void hookEvents ( ) { } boolean hooks ( int eventType ) { } void invalidateVisibleRegion ( int control ) { } void invalWindowRgn ( int window , int rgn ) { } public boolean isDisposed ( ) { } boolean isDrawing ( int control ) { } boolean isEnabled ( ) { } public boolean isListening ( int eventType ) { } boolean isTrimHandle ( int trimHandle ) { } boolean isValidSubclass ( ) { } boolean isValidThread ( ) { } int itemCompareProc ( int browser , int itemOne , int itemTwo , int sortProperty ) { }

Fix:
if ( ( OS . HIVIEW ) && ( ( ( OS . VERSION ) >= 4160 ) || ( background != null ) ) ) {