Buggy code:
int alertType = OS . NSInformationalAlertStyle ; if ( ( ( style ) & ( SWT . ICON_ERROR ) ) != 0 ) alertType = OS . NSCriticalAlertStyle ; if ( ( ( style ) & ( SWT . ICON_INFORMATION ) ) != 0 ) alertType = OS . NSInformationalAlertStyle ; if ( ( ( style ) & ( SWT . ICON_QUESTION ) ) != 0 ) alertType = OS . NSInformationalAlertStyle ; if ( ( ( style ) & ( SWT . ICON_WARNING ) ) != 0 ) alertType = OS . NSWarningAlertStyle ; if ( ( ( style ) & ( SWT . ICON_WORKING ) ) != 0 ) alertType = OS . NSInformationalAlertStyle ; alert . setAlertStyle ( alertType ) ; int mask = ( ( ( ( ( ( SWT . YES ) | ( SWT . NO ) ) | ( SWT . OK ) ) | ( SWT . CANCEL ) ) | ( SWT . ABORT ) ) | ( SWT . RETRY ) ) | ( SWT . IGNORE ) ; int bits = ( style ) & mask ; NSString title ; switch ( bits ) { case SWT . OK : title = NSString . stringWith ( SWT . getMessage ( "SWT_OK" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case SWT . CANCEL : title = NSString . stringWith ( SWT . getMessage ( "SWT_Cancel" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case ( SWT . OK ) | ( SWT . CANCEL ) : title = NSString . stringWith ( SWT . getMessage ( "SWT_OK" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_Cancel" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case SWT . YES : title = NSString . stringWith ( SWT . getMessage ( "SWT_Yes" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case SWT . NO : title = NSString . stringWith ( SWT . getMessage ( "SWT_No" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case ( SWT . YES ) | ( SWT . NO ) : title = NSString . stringWith ( SWT . getMessage ( "SWT_Yes" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_No" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case ( ( SWT . YES ) | ( SWT . NO ) ) | ( SWT . CANCEL ) : title = NSString . stringWith ( SWT . getMessage ( "SWT_Yes" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_Cancel" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_No" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case ( SWT . RETRY ) | ( SWT . CANCEL ) : title = NSString . stringWith ( SWT . getMessage ( "SWT_Retry" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_Cancel" ) ) ; alert . addButtonWithTitle ( title ) ; break ; case ( ( SWT . ABORT ) | ( SWT . RETRY ) ) | ( SWT . IGNORE ) : title = NSString . stringWith ( SWT . getMessage ( "SWT_Abort" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_Ignore" ) ) ; alert . addButtonWithTitle ( title ) ; title = NSString . stringWith ( SWT . getMessage ( "SWT_Retry" ) ) ; alert . addButtonWithTitle ( title ) ; break ; } title = NSString . stringWith ( ( ( this . title ) != null ? this . title : "" ) ) ; <START_BUG> new NSWindow ( alert . window ( ) . id ) . setTitle ( title ) ; <END_BUG> NSString message = NSString . stringWith ( ( ( this . message ) != null ? this . message : "" ) ) ; alert . setMessageText ( message ) ; int response = ( ( int ) ( alert . runModal ( ) ) ) ; alert . release ( ) ; switch ( bits ) { case SWT . OK : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . OK ; } break ; case SWT . CANCEL : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . CANCEL ; } break ; case ( SWT . OK ) | ( SWT . CANCEL ) : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . OK ; case OS . NSAlertSecondButtonReturn : return SWT . CANCEL ; } break ; case SWT . YES : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . YES ; } break ; case SWT . NO : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . NO ; } break ; case ( SWT . YES ) | ( SWT . NO ) : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . YES ; case OS . NSAlertSecondButtonReturn : return SWT . NO ; } break ; case ( ( SWT . YES ) | ( SWT . NO ) ) | ( SWT . CANCEL ) : switch ( response ) { case OS . NSAlertFirstButtonReturn : return SWT . YES ; case OS . NSAlertSecondButtonReturn : return SWT . CANCEL ; case OS . NSAlertThirdButtonReturn : return SWT . NO ;

Fix:
alert . window ( ) . setTitle ( title ) ;