Buggy code:
public abstract class Widget { public int handle ; int jniRef ; 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 LAYOUT_NEEDED = 1 << 5 ; static final int LAYOUT_CHANGED = 1 << 6 ; static final int LAYOUT_CHILD = 1 << 7 ; static final int THEME_BACKGROUND = 1 << 8 ; static final int DRAW_BACKGROUND = 1 << 9 ; static final int PARENT_BACKGROUND = 1 << 10 ; static final int RELEASED = 1 << 11 ; static final int DISPOSE_SENT = 1 << 12 ; static final int MOVED = 1 << 13 ; static final int RESIZED = 1 << 14 ; static final int DRAG_DETECT = 1 << 15 ; static final int DEFAULT_WIDTH = 64 ; static final int DEFAULT_HEIGHT = 64 ; static final int CLICK = 1 ; Widget ( ) { } public Widget ( Widget parent , int style ) { } void _addListener ( int eventType , Listener listener ) { } public void addListener ( int eventType , Listener listener ) { } public void addDisposeListener ( DisposeListener listener ) { } void addWidget ( ) { } static int checkBits ( int style , int int0 , int int1 , int int2 , int int3 , int int4 , int int5 ) { } boolean checkEvent ( int e ) { if ( isDisposed ( ) ) return false ; int routedEventType = OS . RoutedEventArgs_typeid ( ) ; int source = 0 ; if ( OS . Type_IsInstanceOfType ( routedEventType , e ) ) { <START_BUG> source = OS . RoutedEventArgs_Source ( e ) ; <END_BUG> } OS . GCHandle_Free ( routedEventType ) ; if ( source == 0 ) return true ; if ( OS . Object_Equals ( source , handle ) ) { OS . GCHandle_Free ( source ) ; return true ; } Widget widget = display . getWidget ( source ) ; OS . GCHandle_Free ( source ) ; if ( widget == ( this ) ) return true ; if ( hasItems ( ) ) { if ( ( this ) == ( widget . getWidgetControl ( ) ) ) return true ; } return false ; } void checkOrientation ( Widget parent ) { } void checkOpened ( ) { } void checkParent ( Widget parent ) { } protected void checkSubclass ( ) { } protected void checkWidget ( ) { } void createHandle ( ) { } int createDotNetString ( String string , boolean fixMnemonic ) { } static String createJavaString ( int ptr ) { } void createWidget ( ) { } void deregister ( ) { } void destroyWidget ( ) { } public void dispose ( ) { } boolean dragOverride ( ) { } static void dumpObjectType ( int object ) { } void dumpVisualTree ( int visual , int depth ) { } void error ( int code ) { } boolean filters ( int eventType ) { } char [ ] fixMnemonic ( String string ) { } public Object getData ( ) { } public Object getData ( String key ) { } public Display getDisplay ( ) { } Menu getMenu ( ) { } String getName ( ) { } String getNameText ( ) { } public int getStyle ( ) { } Control getWidgetControl ( ) { } boolean hasItems ( ) { } void hookEvents ( ) { } boolean hooks ( int eventType ) { } public boolean isDisposed ( ) { } public boolean isListening ( int eventType ) { } boolean isValidSubclass ( ) { } boolean isValidThread ( ) { } void mapEvent ( int hwnd , Event event ) { } boolean mnemonicMatch ( int accessText , char key ) { } public void notifyListeners ( int eventType , Event event ) { } void postEvent ( int eventType ) { } void postEvent ( int eventType , Event event ) { } void register ( ) { } void release ( boolean destroy ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeListener ( int eventType , Listener listener ) { } protected void removeListener ( int eventType , SWTEventListener listener ) { } public void removeDisposeListener ( DisposeListener listener ) { } boolean sendDragEvent ( int e ) { } boolean sendDragEvent ( int button , int stateMask , int x , int y ) { } void sendEvent ( Event event ) { } void sendEvent ( int eventType ) { } void sendEvent ( int eventType , Event event ) { } void sendEvent ( int eventType , Event event , boolean send ) { } boolean sendKeyEvent ( int type , int e , boolean textInput ) { } boolean sendMouseEvent ( int type , int e , boolean send ) { } void setClipping ( int widget , boolean clip ) { } public void setData ( Object data ) { } public void setData ( String key , Object value ) { } boolean sendFocusEvent ( int type ) { } boolean setInputState ( Event event , int type , int mouseEvent , int keyEvent ) { } boolean setKeyState ( Event event , int type , int e ) { } boolean showMenu ( int x , int y ) { } int topHandle ( ) { } public String toString ( ) { } void updateLayout ( int updateHandle ) { } }

Fix:
source = OS . RoutedEventArgs_OriginalSource ( e ) ;