Buggy code:
static final int FILL = ( ( GC . CLIPPING ) | ( GC . TRANSFORM ) ) | ( GC . BACKGROUND ) ; static final float [ ] LINE_DOT = new float [ ] { 1 , 1 } ; static final float [ ] LINE_DASH = new float [ ] { 3 , 1 } ; static final float [ ] LINE_DASHDOT = new float [ ] { 3 , 1 , 1 , 1 } ; static final float [ ] LINE_DASHDOTDOT = new float [ ] { 3 , 1 , 1 , 1 , 1 , 1 } ; static final float [ ] LINE_DOT_ZERO = new float [ ] { 3 , 3 } ; static final float [ ] LINE_DASH_ZERO = new float [ ] { 18 , 6 } ; static final float [ ] LINE_DASHDOT_ZERO = new float [ ] { 9 , 6 , 3 , 6 } ; static final float [ ] LINE_DASHDOTDOT_ZERO = new float [ ] { 9 , 3 , 3 , 3 , 3 , 3 } ; GC ( ) { } public GC ( Drawable drawable ) { } public GC ( Drawable drawable , int style ) { } static int checkStyle ( int style ) { } public static GC cocoa_new ( Drawable drawable , GCData data ) { } int applierFunc ( int info , int elementPtr ) { } NSAutoreleasePool checkGC ( int mask ) { } public void copyArea ( Image image , int x , int y ) { } void copyArea ( Image image , int x , int y , int srcImage ) { } public void copyArea ( int srcX , int srcY , int width , int height , int destX , int destY ) { } public void copyArea ( int srcX , int srcY , int width , int height , int destX , int destY , boolean paint ) { } static int createCGPathRef ( NSBezierPath nsPath ) { } NSBezierPath createNSBezierPath ( int cgPath ) { } NSAttributedString createString ( String string , int flags , boolean draw ) { } void destroy ( ) { } public void drawArc ( int x , int y , int width , int height , int startAngle , int arcAngle ) { } public void drawFocus ( int x , int y , int width , int height ) { } public void drawImage ( Image image , int x , int y ) { } public void drawImage ( Image image , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight ) { } void drawImage ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple ) { } public void drawLine ( int x1 , int y1 , int x2 , int y2 ) { } public void drawOval ( int x , int y , int width , int height ) { } public void drawPath ( Path path ) { } public void drawPoint ( int x , int y ) { } public void drawPolygon ( int [ ] pointArray ) { } public void drawPolyline ( int [ ] pointArray ) { } public void drawRectangle ( int x , int y , int width , int height ) { } public void drawRectangle ( Rectangle rect ) { } public void drawRoundRectangle ( int x , int y , int width , int height , int arcWidth , int arcHeight ) { } public void drawString ( String string , int x , int y ) { } public void drawString ( String string , int x , int y , boolean isTransparent ) { } public void drawText ( String string , int x , int y ) { } public void drawText ( String string , int x , int y , boolean isTransparent ) { } public void drawText ( String string , int x , int y , int flags ) { if ( ( handle ) == null ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( string == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; <START_BUG> NSAutoreleasePool pool = checkGC ( ( ( ( GC . CLIPPING ) | ( GC . TRANSFORM ) ) | ( GC . FONT ) ) ) ; <END_BUG> try { handle . saveGraphicsState ( ) ; boolean mode = true ; switch ( data . textAntialias ) { case SWT . DEFAULT : if ( ! ( handle . isDrawingToScreen ( ) ) ) mode = false ; break ; case SWT . OFF : mode = false ; break ; case SWT . ON : mode = true ; break ; } handle . setShouldAntialias ( mode ) ; NSAttributedString str = createString ( string , flags , true ) ; if ( ( flags & ( SWT . DRAW_TRANSPARENT ) ) == 0 ) { NSSize size = str . size ( ) ; NSRect rect = new NSRect ( ) ; rect . x = x ; rect . y = y ; rect . width = size . width ; rect . height = size . height ; NSColor bg = data . bg ; if ( bg == null ) { float [ ] color = data . background ; bg = data . bg = NSColor . colorWithDeviceRed ( color [ 0 ] , color [ 1 ] , color [ 2 ] , ( ( data . alpha ) // 255.0F ) ) ; bg . retain ( ) ; } bg . setFill ( ) ; NSBezierPath . fillRect ( rect ) ; str . drawInRect ( rect ) ; }

Fix:
NSAutoreleasePool pool = checkGC ( ( ( ( ( GC . CLIPPING ) | ( GC . TRANSFORM ) ) | ( GC . FONT ) ) | ( GC . FOREGROUND_FILL ) ) ) ;