Buggy code:
static final int LAYOUT_CHILD = 1 << 14 ; static final int RELEASED = 1 << 15 ; static final int DISPOSE_SENT = 1 << 16 ; static final int FOREIGN_HANDLE = 1 << 17 ; static final int DRAG_DETECT = 1 << 18 ; static final int SAFARI_EVENTS_FIX = 1 << 19 ; static final String SAFARI_EVENTS_FIX_KEY = "org.eclipse.swt.internal.safariEventsFix" ; static final String GLCONTEXT_KEY = "org.eclipse.swt.internal.cocoa.glcontext" ; static final int DEFAULT_WIDTH = 64 ; static final int DEFAULT_HEIGHT = 64 ; Widget ( ) { } public Widget ( Widget parent , int style ) { } int accessibilityActionDescription ( int id , int sel , int arg0 ) { } int accessibilityActionNames ( int id , int sel ) { } int accessibilityAttributeNames ( int id , int sel ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } int accessibilityAttributeValue_forParameter ( int id , int sel , int arg0 , int arg1 ) { } int accessibilityFocusedUIElement ( int id , int sel ) { } int accessibilityHitTest ( int id , int sel , NSPoint point ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } int accessibilityParameterizedAttributeNames ( int id , int sel ) { } void accessibilityPerformAction ( int id , int sel , int arg0 ) { } String getClipboardText ( ) { } void setClipRegion ( float x , float y ) { } int attributedSubstringFromRange ( int id , int sel , int range ) { } void callSuper ( int id , int sel ) { } void callSuper ( int id , int sel , int arg0 ) { } void callSuper ( int id , int sel , NSRect arg0 ) { } void callSuper ( int id , int sel , NSRect arg0 , int arg1 ) { } int callSuper ( int id , int sel , int arg0 , NSRect arg1 , int arg2 ) { } boolean callSuperBoolean ( int id , int sel ) { } boolean canBecomeKeyWindow ( int id , int sel ) { } NSSize cellSize ( int id , int sel ) { } boolean callSuperBoolean ( int id , int sel , int arg0 ) { } boolean callSuperBoolean ( int id , int sel , NSRange range , int arg1 ) { } int callSuperObject ( int id , int sel ) { } int callSuperObject ( int id , int sel , int arg0 ) { } boolean canDragRowsWithIndexes_atPoint ( int id , int sel , int arg0 , int arg1 ) { } int characterIndexForPoint ( int id , int sel , int point ) { } boolean acceptsFirstMouse ( int id , int sel , int theEvent ) { } boolean acceptsFirstResponder ( int id , int sel ) { } boolean becomeFirstResponder ( int id , int sel ) { } void becomeKeyWindow ( int id , int sel ) { } boolean resignFirstResponder ( int id , int sel ) { } public void addListener ( int eventType , Listener listener ) { } void _addListener ( int eventType , Listener listener ) { } public void addDisposeListener ( DisposeListener listener ) { } boolean canBecomeKeyView ( int id , int sel ) { } static int checkBits ( int style , int int0 , int int1 , int int2 , int int3 , int int4 , int int5 ) { } void checkOpen ( ) { } void checkOrientation ( Widget parent ) { } void checkParent ( Widget parent ) { } protected void checkSubclass ( ) { } protected void checkWidget ( ) { Display display = this . display ; if ( display == null ) error ( ERROR_WIDGET_DISPOSED ) ; <START_BUG> if ( ( ( display . thread ) != ( Thread . currentThread ( ) ) ) && ( ! ( display . isEmbedded ) ) ) <END_BUG> error ( ERROR_THREAD_INVALID_ACCESS ) ; if ( ( ( state ) & ( Widget . DISPOSED ) ) != 0 ) error ( ERROR_WIDGET_DISPOSED ) ; } boolean textView_clickOnLink_atIndex ( int id , int sel , int textView , int link , int charIndex ) { } void collapseItem_collapseChildren ( int id , int sel , int item , boolean children ) { } void copyToClipboard ( char [ ] buffer ) { } void createHandle ( ) { } void createJNIRef ( ) { } void createWidget ( ) { } void comboBoxSelectionDidChange ( int id , int sel , int notification ) { } void deregister ( ) { } void destroyJNIRef ( ) { } void destroyWidget ( ) { } public void dispose ( ) { } void doCommandBySelector ( int id , int sel , int aSelector ) { } boolean dragSelectionWithEvent ( int id , int sel , int arg0 , int arg1 , int arg2 ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } void drawBackgroundInClipRect ( int id , int sel , NSRect rect ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } void drawInteriorWithFrame_inView ( int id , int sel , NSRect cellFrame , int view ) { } void drawLabelInRect ( int id , int sel , boolean shouldTruncateLabel , NSRect rect ) { } void drawViewBackgroundInRect ( int id , int sel , NSRect rect ) { } void drawWithExpansionFrame_inView ( int id , int sel , NSRect cellFrame , int view ) { } void drawRect ( int id , int sel , NSRect rect ) { } void _drawThemeProgressArea ( int id , int sel , int arg0 ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } void redrawWidget ( NSView view , boolean children ) { }

Fix:
if ( ( display . thread ) != ( Thread . currentThread ( ) ) )