Buggy code:
void addWidget ( NSObject view , Widget widget ) { } public void asyncExec ( Runnable runnable ) { } public void beep ( ) { } void cascadeWindow ( NSWindow window , NSScreen screen ) { } protected void checkDevice ( ) { } void checkEnterExit ( Control control , NSEvent nsEvent , boolean send ) { } protected void checkSubclass ( ) { } public Display ( ) { } public Display ( DeviceData data ) { } static void checkDisplay ( Thread thread , boolean multiple ) { } static String convertToLf ( String text ) { } void clearModal ( Shell shell ) { } public void close ( ) { } protected void create ( DeviceData data ) { } void createDisplay ( DeviceData data ) { } int cursorSetProc ( int id , int sel ) { } static void deregister ( Display display ) { } protected void destroy ( ) { } void destroyDisplay ( ) { } public void disposeExec ( Runnable runnable ) { } void error ( int 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 ) { } boolean hasDefaultButton ( ) { } 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 ) { <START_BUG> int widget = OS . objc_msgSend ( OS . objc_msgSend ( cls , sel_alloc ) , sel_init ) ; <END_BUG> int font = 0 ; if ( OS . objc_msgSend_bool ( widget , sel_respondsToSelector_ , sel ) ) { font = OS . objc_msgSend ( widget , sel ) ; } NSFont result = null ; if ( font != 0 ) { result = new NSFont ( font ) ; } else { result = NSFont . systemFontOfSize ( NSFont . systemFontSizeForControlSize ( NSRegularControlSize ) ) ; } result . retain ( ) ; OS . objc_msgSend ( widget , sel_release ) ; return result ; } 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 ( ) { } 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 ( ) { }

Fix:
int widget = OS . objc_msgSend ( OS . objc_msgSend ( cls , sel_alloc ) , sel_initWithFrame_ , new NSRect ( ) ) ;