Buggy code:
public class Spinner extends Composite { NSTextField textView ; NSNumberFormatter textFormatter ; NSStepper buttonView ; int pageIncrement = 10 ; int digits = 0 ; int textLimit = Spinner . LIMIT ; static int GAP = 0 ; public static final int LIMIT ; public Spinner ( Composite parent , int style ) { } boolean acceptsFirstResponder ( int id , int sel ) { } public void addModifyListener ( ModifyListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } void addVerifyListener ( VerifyListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { checkWidget ( ) ; float width = 0 ; float height = 0 ; String string = Double . toString ( buttonView . maxValue ( ) ) ; Font font = Font . cocoa_new ( display , textView . font ( ) ) ; <START_BUG> NSAttributedString str = parent . createString ( string , font , null , 0 , false ) ; <END_BUG> NSSize size = str . size ( ) ; str . release ( ) ; width = ( ( float ) ( size . width ) ) ; height = ( ( float ) ( size . height ) ) ; NSRect frameRect = textView . frame ( ) ; NSCell cell = new NSCell ( textView . cell ( ) ) ; NSRect cellRect = cell . drawingRectForBounds ( frameRect ) ; width += ( frameRect . width ) - ( cellRect . width ) ; height += ( frameRect . height ) - ( cellRect . height ) ; width += Spinner . GAP ; size = buttonView . cell ( ) . cellSize ( ) ; width += ( ( int ) ( size . width ) ) ; height = Math . max ( height , size . height ) ; if ( wHint != ( SWT . DEFAULT ) ) width = wHint ; if ( hHint != ( SWT . DEFAULT ) ) height = hHint ; Rectangle trim = computeTrim ( 0 , 0 , ( ( int ) ( Math . ceil ( width ) ) ) , ( ( int ) ( Math . ceil ( height ) ) ) ) ; return new Point ( trim . width , trim . height ) ; } public void copy ( ) { } void createHandle ( ) { } public void cut ( ) { } void enableWidget ( boolean enabled ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } NSView focusView ( ) { } public int getDigits ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } int getSelectionText ( boolean [ ] parseFail ) { } public String getText ( ) { } public int getTextLimit ( ) { } boolean isEventView ( int id ) { } public void paste ( ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void removeModifyListener ( ModifyListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void removeVerifyListener ( VerifyListener listener ) { } void resized ( ) { } boolean sendKeyEvent ( NSEvent nsEvent , int type ) { } void sendSelection ( ) { } void updateBackground ( ) { } public void setDigits ( int value ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } public void setSelection ( int value ) { } void setSelection ( int value , boolean setPos , boolean setText , boolean notify ) { } void setSmallSize ( ) { } char [ ] setText ( String string , int start , int end , boolean notify ) { } public void setTextLimit ( int limit ) { } public void setValues ( int selection , int minimum , int maximum , int digits , int increment , int pageIncrement ) { } boolean shouldChangeTextInRange_replacementString ( int id , int sel , int affectedCharRange , int replacementString ) { } void textDidChange ( int id , int sel , int aNotification ) { } NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange ( int id , int sel , int aTextView , int oldSelectedCharRange , int newSelectedCharRange ) { } void textDidEndEditing ( int id , int sel , int aNotification ) { } void updateCursorRects ( boolean enabled ) { } String verifyText ( String string , int start , int end , NSEvent keyEvent ) { } }

Fix:
NSAttributedString str = parent . createString ( string , font , null , 0 , true , false ) ;