Buggy code:
, new int [ ] { 82 , SWT . KEYPAD_0 } , new int [ ] { 83 , SWT . KEYPAD_1 } , new int [ ] { 84 , SWT . KEYPAD_2 } , new int [ ] { 85 , SWT . KEYPAD_3 } , new int [ ] { 86 , SWT . KEYPAD_4 } , new int [ ] { 87 , SWT . KEYPAD_5 } , new int [ ] { 88 , SWT . KEYPAD_6 } , new int [ ] { 89 , SWT . KEYPAD_7 } , new int [ ] { 91 , SWT . KEYPAD_8 } , new int [ ] { 92 , SWT . KEYPAD_9 } , new int [ ] { 81 , SWT . KEYPAD_EQUAL } , new int [ ] { 57 , SWT . CAPS_LOCK } , new int [ ] { 71 , SWT . NUM_LOCK } , new int [ ] { 114 , SWT . HELP } } ; static String APP_NAME = "SWT" ; static final String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget" ; static final String SWT_OBJECT = "SWT_OBJECT" ; static Display Default ; static Display [ ] Displays = new Display [ 4 ] ; static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets." ; Runnable [ ] timerList ; NSTimer [ ] nsTimers ; SWTWindowDelegate timerDelegate ; SWTApplicationDelegate applicationDelegate ; Object data ; String [ ] keys ; Object [ ] values ; static void setDevice ( Device device ) { } static byte [ ] ascii ( String name ) { } static int translateKey ( int key ) { } static int untranslateKey ( int key ) { } void addContext ( NSGraphicsContext context ) { } public void addFilter ( int eventType , Listener listener ) { } public void addListener ( int eventType , Listener listener ) { } void addMenu ( Menu menu ) { } void addPopup ( Menu menu ) { } void addWidget ( NSObject view , Widget widget ) { } public void asyncExec ( Runnable runnable ) { } public void beep ( ) { } void cascadeWindow ( NSWindow window , NSScreen screen ) { } protected void checkDevice ( ) { } 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 ) { if ( ( OS . VERSION ) < 4176 ) { System . out . println ( ( ( ( ( "***WARNING:<seq2seq4repair_space>SWT<seq2seq4repair_space>requires<seq2seq4repair_space>MacOS<seq2seq4repair_space>X<seq2seq4repair_space>version<seq2seq4repair_space>" + 10 ) + "." ) + 5 ) + "<seq2seq4repair_space>or<seq2seq4repair_space>greater" ) ) ; System . out . println ( ( ( ( ( ( "***WARNING:<seq2seq4repair_space>Detected:<seq2seq4repair_space>" + ( Integer . toHexString ( ( ( ( OS . VERSION ) & 65280 ) > > 8 ) ) ) ) + "." ) + ( Integer . toHexString ( ( ( ( OS . VERSION ) & 240 ) > > 4 ) ) ) ) + "." ) + ( Integer . toHexString ( ( ( OS . VERSION ) & 15 ) ) ) ) ) ; error ( ERROR_NOT_IMPLEMENTED ) ; } NSThread nsthread = NSThread . currentThread ( ) ; NSMutableDictionary dictionary = nsthread . threadDictionary ( ) ; NSString key = NSString . stringWith ( "SWT_NSAutoreleasePool" ) ; NSNumber id = new NSNumber ( dictionary . objectForKey ( key ) ) ; <START_BUG> pool = new NSAutoreleasePool ( id . intValue ( ) ) ; <END_BUG> application = NSApplication . sharedApplication ( ) ; if ( ! ( application . isRunning ( ) ) ) { int [ ] psn = new int [ 2 ] ; if ( ( OS . GetCurrentProcess ( psn ) ) == ( OS . noErr ) ) { int pid = OS . getpid ( ) ; int ptr = OS . getenv ( Display . ascii ( ( "APP_NAME_" + pid ) ) ) ; if ( ( ptr == 0 ) && ( ( Display . APP_NAME ) != null ) ) { ptr = NSString . stringWith ( Display . APP_NAME ) . UTF8String ( ) ; } if ( ptr != 0 ) OS . CPSSetProcessName ( psn , ptr ) ; OS . TransformProcessType ( psn , kProcessTransformToForegroundApplication ) ; OS . SetFrontProcess ( psn ) ; ptr = OS . getenv ( Display . ascii ( ( "APP_ICON_" + pid ) ) ) ; if ( ptr != 0 ) { NSString path = NSString . stringWithUTF8String ( ptr ) ; NSImage image = ( ( NSImage ) ( new NSImage ( ) . alloc ( ) ) ) ; image = image . initByReferencingFile ( path ) ; dockImage = image ; application . setApplicationIconImage ( image ) ; } } String className = "SWTApplication" ; int cls ; if ( ( cls = OS . objc_lookUpClass ( className ) ) == 0 ) { Class clazz = getClass ( ) ; Display . applicationCallback2 = new Callback ( clazz , "applicationProc" , 2 ) ; int proc2 = Display . applicationCallback2 . getAddress ( ) ; if ( proc2 == 0 ) error ( ERROR_NO_MORE_CALLBACKS ) ; Display . applicationCallback3 = new Callback ( clazz , "applicationProc" , 3 ) ; int proc3 = Display . applicationCallback3 . getAddress ( ) ; if ( proc3 == 0 ) error ( ERROR_NO_MORE_CALLBACKS ) ; Display . applicationCallback6 = new Callback ( clazz , "applicationProc" , 6 ) ; int proc6 = Display . applicationCallback6 . getAddress ( ) ; if ( proc6 == 0 ) error ( ERROR_NO_MORE_CALLBACKS ) ; cls = OS . objc_allocateClassPair ( class_NSApplication , className , 0 ) ;

Fix:
pool = new NSAutoreleasePool ( id . integerValue ( ) ) ;