Buggy code:
boolean filterEvent ( Event event ) { } boolean filters ( int eventType ) { } public Widget findWidget ( int handle ) { } public Widget findWidget ( int handle , int id ) { } public Widget findWidget ( Widget widget , int id ) { } public static Display findDisplay ( Thread thread ) { } public Shell getActiveShell ( ) { } public Rectangle getBounds ( ) { } Rectangle getBounds ( NSArray screens ) { } public static Display getCurrent ( ) { } int getCaretBlinkTime ( ) { } public Rectangle getClientArea ( ) { } public Control getCursorControl ( ) { } public Point getCursorLocation ( ) { } public Point [ ] getCursorSizes ( ) { } public static Display getDefault ( ) { } public Object getData ( String key ) { } public Object getData ( ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } static Control GetFocusControl ( NSWindow window ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } int getLastEventTime ( ) { } Menu [ ] getMenus ( Decorations shell ) { } int getMessageCount ( ) { } public Monitor [ ] getMonitors ( ) { } NSRect getPrimaryFrame ( ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Synchronizer getSynchronizer ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } Color getWidgetColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } int getToolTipTime ( ) { } Widget getWidget ( int id ) { } static Widget GetWidget ( int id ) { } Widget getWidget ( NSView view ) { } protected void init ( ) { } void initApplicationDelegate ( ) { } void addEventMethods ( int cls , int proc2 , int proc3 , int drawRectProc , int hitTestProc , int needsDisplayInRectProc ) { } void addFrameMethods ( int cls , int setFrameOriginProc , int setFrameSizeProc ) { } void addAccessibilityMethods ( int cls , int proc2 , int proc3 , int proc4 , int accessibilityHitTestProc ) { } int registerCellSubclass ( int cellClass , int size , int align , byte [ ] types ) { } void initClasses ( ) { } NSFont getFont ( int cls , int sel ) { } void initFonts ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } static boolean isValidClass ( Class clazz ) { } boolean isValidThread ( ) { } public boolean post ( Event event ) { } void postEvent ( Event event ) { } public Point map ( Control from , Control to , Point point ) { } public Point map ( Control from , Control to , int x , int y ) { } public Rectangle map ( Control from , Control to , Rectangle rectangle ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } int observerProc ( int observer , int activity , int info ) { } public boolean readAndDispatch ( ) { checkDevice ( ) ; if ( ( loopCounter ) == 0 ) { pool . release ( ) ; pool = ( ( NSAutoreleasePool ) ( new NSAutoreleasePool ( ) . alloc ( ) . init ( ) ) ) ; } ( loopCounter ) ++ ; try { boolean events = false ; events |= runTimers ( ) ; events |= runContexts ( ) ; events |= runPopups ( ) ; NSEvent event = application . nextEventMatchingMask ( 0 , null , NSDefaultRunLoopMode , true ) ; if ( event != null ) { events = true ; application . sendEvent ( event ) ; } <START_BUG> events = runPaint ( ) ; <END_BUG> if ( events || ( runDeferredEvents ( ) ) ) { return true ; } return runAsyncMessages ( false ) ; } finally { ( loopCounter ) -- ; } } static void register ( Display display ) { } protected void release ( ) { } void releaseDisplay ( ) { } void removeContext ( GCData context ) { } public void removeFilter ( int eventType , Listener listener ) { } public void removeListener ( int eventType , Listener listener ) { } Widget removeWidget ( NSObject view ) { } void removeMenu ( Menu menu ) { } void removePopup ( Menu menu ) { } boolean runAsyncMessages ( boolean all ) { } boolean runContexts ( ) { } boolean runDeferredEvents ( ) { } boolean runPaint ( ) { } boolean runPopups ( ) { } boolean runTimers ( ) { } void sendEvent ( int eventType , Event event ) { } public static void setAppName ( String name ) { } Runnable hoverTimer = new Runnable ( ) { public void run ( ) { } } ; Runnable caretTimer = new Runnable ( ) { public void run ( ) { } } ; void setCurrentCaret ( Caret caret ) { } void setCursor ( Control control ) { } public void setCursorLocation ( int x , int y ) { } public void setCursorLocation ( Point point ) { } public void setData ( String key , Object value ) { } void setMenuBar ( Menu menu ) { } void setModalShell ( Shell shell ) { } public void setData ( Object data ) { }

Fix:
events |= runPaint ( ) ;