Buggy code:
, new int [ ] { OS . VK_NUMPAD1 , SWT . KEYPAD_1 } , new int [ ] { OS . VK_NUMPAD2 , SWT . KEYPAD_2 } , new int [ ] { OS . VK_NUMPAD3 , SWT . KEYPAD_3 } , new int [ ] { OS . VK_NUMPAD4 , SWT . KEYPAD_4 } , new int [ ] { OS . VK_NUMPAD5 , SWT . KEYPAD_5 } , new int [ ] { OS . VK_NUMPAD6 , SWT . KEYPAD_6 } , new int [ ] { OS . VK_NUMPAD7 , SWT . KEYPAD_7 } , new int [ ] { OS . VK_NUMPAD8 , SWT . KEYPAD_8 } , new int [ ] { OS . VK_NUMPAD9 , SWT . KEYPAD_9 } , new int [ ] { OS . VK_CAPITAL , SWT . CAPS_LOCK } , new int [ ] { OS . VK_NUMLOCK , SWT . NUM_LOCK } , new int [ ] { OS . VK_SCROLL , SWT . SCROLL_LOCK } , new int [ ] { OS . VK_PAUSE , SWT . PAUSE } , new int [ ] { OS . VK_CANCEL , SWT . BREAK } , new int [ ] { OS . VK_SNAPSHOT , SWT . PRINT_SCREEN } } ; static Display Default ; static Display [ ] Displays = new Display [ 4 ] ; static Monitor [ ] monitors = null ; static int monitorCount = 0 ; Shell [ ] modalShells ; Shell modalDialogShell ; static boolean TrimEnabled = false ; static final int SWT_GETACCELCOUNT = OS . WM_APP ; static final int SWT_GETACCEL = ( OS . WM_APP ) + 1 ; static final int SWT_KEYMSG = ( OS . WM_APP ) + 2 ; static final int SWT_DESTROY = ( OS . WM_APP ) + 3 ; static final int SWT_RESIZE = ( OS . WM_APP ) + 4 ; static final int SWT_TRAYICONMSG = ( OS . WM_APP ) + 5 ; static int SWT_TASKBARCREATED ; static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets." ; static void setDevice ( Device device ) { } public Display ( ) { } public Display ( DeviceData data ) { } Control _getFocusControl ( ) { } void addBar ( Menu menu ) { } void addControl ( int handle , Control control ) { } public void addFilter ( int eventType , Listener listener ) { } public void addListener ( int eventType , Listener listener ) { } void addMenuItem ( MenuItem item ) { } void addPopup ( Menu menu ) { } int asciiKey ( int key ) { } public void asyncExec ( Runnable runnable ) { } public void beep ( ) { } protected void checkSubclass ( ) { } protected void checkDevice ( ) { } static synchronized void checkDisplay ( Thread thread ) { } void clearModal ( Shell shell ) { } int controlKey ( int key ) { } public void close ( ) { } protected void create ( DeviceData data ) { } void createDisplay ( DeviceData data ) { } static synchronized void deregister ( Display display ) { } protected void destroy ( ) { } void destroyDisplay ( ) { } public void disposeExec ( Runnable runnable ) { } void drawMenuBars ( ) { } int embeddedProc ( int hwnd , int msg , int wParam , int lParam ) { } void error ( int code ) { } boolean filterEvent ( Event event ) { } boolean filters ( int eventType ) { } boolean filterMessage ( MSG msg ) { } public Widget findWidget ( int handle ) { } Control findControl ( int handle ) { } public static synchronized Display findDisplay ( Thread thread ) { } public Shell getActiveShell ( ) { } public Rectangle getBounds ( ) { } public static synchronized Display getCurrent ( ) { } public Rectangle getClientArea ( ) { } Control getControl ( int handle ) { if ( handle == 0 ) return null ; int index = ( OS . GetWindowLong ( handle , GWL_USERDATA ) ) - 1 ; if ( ( 0 <= index ) && ( index < ( controlTable . length ) ) ) { Control control = controlTable [ index ] ; <START_BUG> if ( ( control != null ) && ( ( control . handle ) == handle ) ) { <END_BUG> return control ; } } return null ; } public Control getCursorControl ( ) { } public Point getCursorLocation ( ) { } public Point [ ] getCursorSizes ( ) { } public static synchronized Display getDefault ( ) { } static boolean isValidClass ( Class clazz ) { } public Object getData ( String key ) { } public Object getData ( ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } ImageList getImageList ( Point size ) { } ImageList getToolImageList ( Point size ) { } ImageList getToolHotImageList ( Point size ) { } ImageList getToolDisabledImageList ( Point size ) { } int getLastEventTime ( ) { } MenuItem getMenuItem ( int id ) { } int getMessageCount ( ) { } Shell getModalShell ( ) { } Shell getModalDialogShell ( ) { } public Monitor [ ] getMonitors ( ) { } int getMsgProc ( int code , int wParam , int lParam ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Font getSystemFont ( ) { } public Image getSystemImage ( int id ) { }

Fix:
if ( ( control != null ) && ( control . checkHandle ( handle ) ) ) {