Buggy code:
public class Button extends Control { String text ; Image image ; boolean grayed ; static final int EXTRA_HEIGHT = 2 ; static final int EXTRA_WIDTH = 6 ; static final int IMAGE_GAP = 2 ; public Button ( Composite parent , int style ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } NSSize cellSize ( int id , int sel ) { } static int checkStyle ( int style ) { } void click ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } NSAttributedString createString ( ) { } void createHandle ( ) { if ( ( ( style ) & ( SWT . PUSH ) ) == 0 ) state |= THEME_BACKGROUND ; NSButton widget = ( ( NSButton ) ( new SWTButton ( ) . alloc ( ) ) ) ; widget . init ( ) ; NSButtonCell cell = ( ( NSButtonCell ) ( new SWTButtonCell ( ) . alloc ( ) . init ( ) ) ) ; widget . setCell ( cell ) ; cell . release ( ) ; int type = OS . NSMomentaryLightButton ; if ( ( ( style ) & ( SWT . PUSH ) ) != 0 ) { boolean flat = ( ( style ) & ( SWT . FLAT ) ) != 0 ; if ( ! flat ) { NSView superview = widget . superview ( ) ; while ( superview != null ) { if ( superview . isKindOfClass ( class_NSTableView ) ) { flat = true ; break ; } superview = superview . superview ( ) ; } } if ( flat ) { widget . setBezelStyle ( NSShadowlessSquareBezelStyle ) ; } else { widget . setBezelStyle ( NSRoundedBezelStyle ) ; } } else if ( ( ( style ) & ( SWT . CHECK ) ) != 0 ) { type = OS . NSSwitchButton ; } else if ( ( ( style ) & ( SWT . RADIO ) ) != 0 ) { type = OS . NSRadioButton ; } else if ( ( ( style ) & ( SWT . TOGGLE ) ) != 0 ) { type = OS . NSPushOnPushOffButton ; if ( ( ( style ) & ( SWT . FLAT ) ) != 0 ) { widget . setBezelStyle ( NSShadowlessSquareBezelStyle ) ; } else { widget . setBezelStyle ( NSRoundedBezelStyle ) ; } } else if ( ( ( style ) & ( SWT . ARROW ) ) != 0 ) { widget . setBezelStyle ( NSShadowlessSquareBezelStyle ) ; } widget . setButtonType ( type ) ; <START_BUG> widget . setTitle ( NSString . stringWith ( "" ) ) ; <END_BUG> widget . setImagePosition ( NSImageLeft ) ; widget . setTarget ( widget ) ; widget . setAction ( sel_sendSelection ) ; view = widget ; _setAlignment ( style ) ; } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } void drawInteriorWithFrame_inView ( int id , int sel , NSRect cellRect , int viewid ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } public int getAlignment ( ) { } public boolean getGrayed ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } int nextState ( int id , int sel ) { } void register ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } void sendSelection ( ) { } public void setAlignment ( int alignment ) { } void _setAlignment ( int alignment ) { } void setBackgroundColor ( NSColor nsColor ) { } void setBackgroundImage ( NSImage image ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } NSRect titleRectForBounds ( int id , int sel , NSRect cellFrame ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateAlignment ( ) { } }

Fix:
widget . setTitle ( NSString . string ( ) ) ;