Buggy code:
public class Shell extends Decorations { NSWindow window ; SWTWindowDelegate windowDelegate ; int tooltipOwner ; int tooltipTag ; int tooltipUserData ; boolean opened ; boolean moved ; boolean resized ; boolean fullScreen ; boolean center ; Control lastActive ; Rectangle normalBounds ; boolean keyInputHappened ; NSRect currentFrame ; NSRect fullScreenFrame ; static int DEFAULT_CLIENT_WIDTH = - 1 ; static int DEFAULT_CLIENT_HEIGHT = - 1 ; public Shell ( ) { } public Shell ( int style ) { } public Shell ( Display display ) { } public Shell ( Display display , int style ) { } Shell ( Display display , Shell parent , int style , int handle , boolean embedded ) { } public Shell ( Shell parent ) { } public Shell ( Shell parent , int style ) { } public static Shell internal_new ( Display display , int handle ) { } public static Shell cocoa_new ( Display display , int handle ) { } static int checkStyle ( Shell parent , int style ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } public void addShellListener ( ShellListener listener ) { } void becomeKeyWindow ( int id , int sel ) { } void bringToTop ( boolean force ) { } boolean canBecomeKeyWindow ( int id , int sel ) { } void checkOpen ( ) { } void center ( ) { } public void close ( ) { } void closeWidget ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { state |= HIDDEN ; if ( ( window ) == null ) { window = ( ( NSWindow ) ( new SWTWindow ( ) . alloc ( ) ) ) ; int styleMask = OS . NSBorderlessWindowMask ; if ( ( ( style ) & ( SWT . NO_TRIM ) ) == 0 ) { if ( ( ( style ) & ( SWT . TITLE ) ) != 0 ) styleMask |= OS . NSTitledWindowMask ; if ( ( ( style ) & ( SWT . CLOSE ) ) != 0 ) styleMask |= OS . NSClosableWindowMask ; if ( ( ( style ) & ( SWT . MIN ) ) != 0 ) styleMask |= OS . NSMiniaturizableWindowMask ; if ( ( ( style ) & ( SWT . MAX ) ) != 0 ) styleMask |= OS . NSResizableWindowMask ; if ( ( ( style ) & ( SWT . RESIZE ) ) != 0 ) styleMask |= OS . NSResizableWindowMask ; } NSScreen screen = null ; NSScreen primaryScreen = new NSScreen ( NSScreen . screens ( ) . objectAtIndex ( 0 ) ) ; if ( ( parent ) != null ) screen = parent . getShell ( ) . window . screen ( ) ; if ( screen == null ) screen = primaryScreen ; window = window . initWithContentRect ( new NSRect ( ) , styleMask , NSBackingStoreBuffered , false , screen ) ; if ( ( ( ( style ) & ( ( ( SWT . NO_TRIM ) | ( SWT . BORDER ) ) | ( SWT . SHELL_TRIM ) ) ) == 0 ) || ( ( ( style ) & ( ( SWT . TOOL ) | ( SWT . SHEET ) ) ) != 0 ) ) { window . setHasShadow ( true ) ; } if ( ( ( style ) & ( SWT . NO_TRIM ) ) == 0 ) { NSSize size = window . minSize ( ) ; <START_BUG> size . width = NSWindow . minFrameWidthWithTitle ( NSString . stringWith ( "" ) , styleMask ) ; <END_BUG> window . setMinSize ( size ) ; } if ( fixResize ( ) ) { if ( window . respondsToSelector ( sel_setMovable_ ) ) { OS . objc_msgSend ( window . id , sel_setMovable_ , 0 ) ; } } display . cascadeWindow ( window , screen ) ; NSRect screenFrame = screen . frame ( ) ; float width = ( ( screenFrame . width ) * 5 ) // 8 ; float height = ( ( screenFrame . height ) * 5 ) // 8 ; NSRect frame = window . frame ( ) ; NSRect primaryFrame = primaryScreen . frame ( ) ; frame . y = ( primaryFrame . height ) - ( ( ( primaryFrame . height ) - ( ( frame . y ) + ( frame . height ) ) ) + height ) ; frame . width = width ; frame . height = height ; window . setFrame ( frame , false ) ; if ( ( ( style ) & ( SWT . ON_TOP ) ) != 0 ) { window . setLevel ( NSStatusWindowLevel ) ; } super . createHandle ( ) ; topView ( ) . setHidden ( true ) ; } else { state &= ~ ( HIDDEN ) ; super . createHandle ( ) ; style |= SWT . NO_BACKGROUND ; } if ( ( parent ) != null ) window . setCollectionBehavior ( NSWindowCollectionBehaviorMoveToActiveSpace ) ; window . setAcceptsMouseMovedEvents ( true ) ; windowDelegate = ( ( SWTWindowDelegate ) ( new SWTWindowDelegate ( ) . alloc ( ) . init ( ) ) ) ; window . setDelegate ( windowDelegate ) ; id id = window . fieldEditor ( true , null ) ; if ( id != null ) { OS . object_setClass ( id . id , OS . objc_getClass ( "SWTEditorView" ) ) ; } } void deregister ( ) { } void destroyWidget ( ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } Control findBackgroundControl ( ) { } Composite findDeferredControl ( ) { } Cursor findCursor ( ) { } boolean fixResize ( ) { }

Fix:
size . width = NSWindow . minFrameWidthWithTitle ( NSString . string ( ) , styleMask ) ;