Buggy code:
void addPopup ( Menu menu ) { } int asciiKey ( int key ) { } public void asyncExec ( Runnable runnable ) { } public void beep ( ) { } protected void checkSubclass ( ) { } protected void checkDevice ( ) { } static void checkDisplay ( Thread thread , boolean multiple ) { } void clearModal ( Shell shell ) { } int controlKey ( int key ) { } public void close ( ) { } protected void create ( DeviceData data ) { } void createDisplay ( DeviceData data ) { } static int create32bitDIB ( Image image ) { } static int create32bitDIB ( int hBitmap , int alpha , byte [ ] alphaData , int transparentPixel ) { } static Image createIcon ( Image image ) { } static int createMaskFromAlpha ( ImageData data , int destWidth , int destHeight ) { } static 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 ) { } Control findControl ( int handle ) { } public Widget findWidget ( int handle ) { } public Widget findWidget ( int handle , int id ) { } public Widget findWidget ( Widget widget , int id ) { } int foregroundIdleProc ( int code , int wParam , int lParam ) { } public static Display findDisplay ( Thread thread ) { } public Shell getActiveShell ( ) { } public Rectangle getBounds ( ) { } public static Display getCurrent ( ) { } int getClickCount ( int type , int button , int hwnd , int lParam ) { } public Rectangle getClientArea ( ) { } Control getControl ( int handle ) { } public Control getCursorControl ( ) { } public Point getCursorLocation ( ) { } public Point [ ] getCursorSizes ( ) { } public static Display getDefault ( ) { } static boolean isValidClass ( Class clazz ) { } public Object getData ( String key ) { } public Object getData ( ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } String getFontName ( LOGFONT logFont ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } ImageList getImageList ( int style , int width , int height ) { } ImageList getImageListToolBar ( int style , int width , int height ) { } ImageList getImageListToolBarDisabled ( int style , int width , int height ) { } ImageList getImageListToolBarHot ( int style , int width , int height ) { } int getLastEventTime ( ) { } MenuItem getMenuItem ( int id ) { } int getMessageCount ( ) { } Shell getModalShell ( ) { } Dialog getModalDialog ( ) { } public Monitor [ ] getMonitors ( ) { } int getMsgProc ( int code , int wParam , int lParam ) { if ( ( embeddedHwnd ) == 0 ) { int hInstance = OS . GetModuleHandle ( null ) ; embeddedHwnd = OS . CreateWindowEx ( 0 , windowClass , null , WS_OVERLAPPED , 0 , 0 , 0 , 0 , 0 , 0 , hInstance , null ) ; embeddedCallback = new Callback ( this , "embeddedProc" , 4 ) ; embeddedProc = embeddedCallback . getAddress ( ) ; if ( ( embeddedProc ) == 0 ) error ( ERROR_NO_MORE_CALLBACKS ) ; OS . SetWindowLongPtr ( embeddedHwnd , GWLP_WNDPROC , embeddedProc ) ; } <START_BUG> if ( ( code >= 0 ) && ( wParam != ( OS . PM_NOREMOVE ) ) ) { <END_BUG> MSG msg = new MSG ( ) ; OS . MoveMemory ( msg , lParam , sizeof ) ; switch ( msg . message ) { case OS . WM_KEYDOWN : case OS . WM_KEYUP : case OS . WM_SYSKEYDOWN : case OS . WM_SYSKEYUP : { Control control = findControl ( msg . hwnd ) ; if ( control != null ) { int hHeap = OS . GetProcessHeap ( ) ; int keyMsg = OS . HeapAlloc ( hHeap , HEAP_ZERO_MEMORY , sizeof ) ; OS . MoveMemory ( keyMsg , msg , sizeof ) ; OS . PostMessage ( hwndMessage , Display . SWT_KEYMSG , wParam , keyMsg ) ; msg . message = OS . WM_NULL ; OS . MoveMemory ( lParam , msg , sizeof ) ; } } } } return OS . CallNextHookEx ( msgHook , ( ( int ) ( code ) ) , wParam , lParam ) ; } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } Image getSortImage ( int direction ) { } public Synchronizer getSynchronizer ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Font getSystemFont ( ) { } public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } int hButtonTheme ( ) { } int hEditTheme ( ) { } int hExplorerBarTheme ( ) { } int hScrollBarTheme ( ) { } int hTabTheme ( ) { } public int internal_new_GC ( GCData data ) { } protected void init ( ) { } public void internal_dispose_GC ( int hDC , GCData data ) { } boolean isXMouseActive ( ) { }

Fix:
if ( ( code >= 0 ) && ( ( wParam & ( OS . PM_REMOVE ) ) != 0 ) ) {