Buggy code:
public abstract class Widget { int style ; int state ; Display display ; EventTable eventTable ; Object data ; int jniRef ; 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 PARENT_BACKGROUND = 1 << 10 ; static final int THEME_BACKGROUND = 1 << 11 ; static final int LAYOUT_NEEDED = 1 << 12 ; static final int LAYOUT_CHANGED = 1 << 13 ; 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 int DEFAULT_WIDTH = 64 ; static final int DEFAULT_HEIGHT = 64 ; Widget ( ) { } public Widget ( Widget parent , int style ) { } String getClipboardText ( ) { } NSBezierPath getClipping ( ) { } int attributedSubstringFromRange ( int id , int sel , int range ) { } void callSuper ( int id , int sel , int arg0 ) { } boolean callSuperBoolean ( int id , int sel ) { } int characterIndexForPoint ( int id , int sel , int point ) { } boolean acceptsFirstResponder ( int id , int sel ) { } boolean becomeFirstResponder ( 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 ) { } 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 ( ) ) ) <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 comboBoxSelectionDidChange ( int id , int sel , int notification ) { } void copyToClipboard ( char [ ] buffer ) { } void createHandle ( ) { } void createJNIRef ( ) { } void createWidget ( ) { } void deregister ( ) { } void destroyJNIRef ( ) { } void destroyWidget ( ) { } public void dispose ( ) { } boolean doCommandBySelector ( int id , int sel , int aSelector ) { } void drawBackground ( int control , int context ) { } void drawInteriorFrame_inView ( int id , int sel , int cellFrame , int view ) { } void drawRect ( int id , int sel , NSRect rect ) { } void drawWidget ( int id , NSRect rect ) { } void error ( int code ) { } boolean filters ( int eventType ) { } NSRect firstRectForCharacterRange ( int id , int sel , int range ) { } int fixMnemonic ( char [ ] buffer ) { } public Object getData ( ) { } public Object getData ( String key ) { } public Display getDisplay ( ) { } public Listener [ ] getListeners ( int eventType ) { } String getName ( ) { } String getNameText ( ) { } public int getStyle ( ) { } boolean hasMarkedText ( int id , int sel ) { } void helpRequested ( int id , int sel , int theEvent ) { } int hitTest ( int id , int sel , NSPoint point ) { } boolean hooks ( int eventType ) { } boolean insertText ( int id , int sel , int string ) { } public boolean isDisposed ( ) { } boolean isFlipped ( int id , int sel ) { } public boolean isListening ( int eventType ) { } boolean isOpaque ( int id , int sel ) { } boolean isValidSubclass ( ) { } boolean isValidThread ( ) { } void flagsChanged ( int id , int sel , int theEvent ) { } void keyDown ( int id , int sel , int theEvent ) { } void keyUp ( int id , int sel , int theEvent ) { } void mouseDown ( int id , int sel , int theEvent ) { } void mouseUp ( int id , int sel , int theEvent ) { } void rightMouseDown ( int id , int sel , int theEvent ) { } void rightMouseUp ( int id , int sel , int theEvent ) { } void otherMouseDown ( int id , int sel , int theEvent ) { } void otherMouseUp ( int id , int sel , int theEvent ) { } void mouseMoved ( int id , int sel , int theEvent ) { }

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