Buggy code:
public void drawText ( String string , int x , int y , boolean isTransparent ) { } public void drawText ( String string , int x , int y , int flags ) { } public boolean equals ( Object object ) { } public void fillArc ( int x , int y , int width , int height , int startAngle , int arcAngle ) { } public void fillGradientRectangle ( int x , int y , int width , int height , boolean vertical ) { } public void fillOval ( int x , int y , int width , int height ) { } public void fillPath ( Path path ) { } public void fillPolygon ( int [ ] pointArray ) { } public void fillRectangle ( int x , int y , int width , int height ) { } public void fillRectangle ( Rectangle rect ) { } public void fillRoundRectangle ( int x , int y , int width , int height , int arcWidth , int arcHeight ) { } int fixMnemonic ( char [ ] buffer ) { } public int getAdvanceWidth ( char ch ) { } public boolean getAdvanced ( ) { } public int getAlpha ( ) { } public int getAntialias ( ) { } public Color getBackground ( ) { } public Pattern getBackgroundPattern ( ) { } public int getCharWidth ( char ch ) { } public Rectangle getClipping ( ) { } public void getClipping ( Region region ) { } public int getFillRule ( ) { } public Font getFont ( ) { } public FontMetrics getFontMetrics ( ) { } public Color getForeground ( ) { } public Pattern getForegroundPattern ( ) { } public GCData getGCData ( ) { } public int getInterpolation ( ) { } public LineAttributes getLineAttributes ( ) { } public int getLineCap ( ) { } public int [ ] getLineDash ( ) { } public int getLineJoin ( ) { } public int getLineStyle ( ) { } public int getLineWidth ( ) { } public int getStyle ( ) { } public int getTextAntialias ( ) { } public void getTransform ( Transform transform ) { } public boolean getXORMode ( ) { } public int hashCode ( ) { } double [ ] identity ( ) { } void init ( Drawable drawable , GCData data , int gdkGC ) { } void initCairo ( ) { } void computeStringSize ( ) { } public boolean isClipped ( ) { } public boolean isDisposed ( ) { } boolean isIdentity ( double [ ] matrix ) { } public void setAdvanced ( boolean advanced ) { } public void setAlpha ( int alpha ) { } public void setAntialias ( int antialias ) { } public void setBackground ( Color color ) { } public void setBackgroundPattern ( Pattern pattern ) { } static void setCairoFont ( int cairo , Font font ) { } static void setCairoFont ( int cairo , int font ) { } static void setCairoRegion ( int cairo , int rgn ) { } static void setCairoPatternColor ( int pattern , int offset , Color c , int alpha ) { } void setCairoClip ( int damageRgn , int clipRgn ) { } void setClipping ( int clipRgn ) { } public void setClipping ( int x , int y , int width , int height ) { } public void setClipping ( Path path ) { } public void setClipping ( Rectangle rect ) { } public void setClipping ( Region region ) { } public void setFont ( Font font ) { } public void setFillRule ( int rule ) { } public void setForeground ( Color color ) { } public void setForegroundPattern ( Pattern pattern ) { } public void setInterpolation ( int interpolation ) { } public void setLineAttributes ( LineAttributes attributes ) { } public void setLineCap ( int cap ) { } public void setLineDash ( int [ ] dashes ) { } public void setLineJoin ( int join ) { } public void setLineStyle ( int lineStyle ) { } public void setLineWidth ( int lineWidth ) { } void setString ( String string , int flags ) { } public void setTextAntialias ( int antialias ) { } public void setTransform ( Transform transform ) { } public void setXORMode ( boolean xor ) { } public Point stringExtent ( String string ) { } public Point textExtent ( String string ) { } public Point textExtent ( String string , int flags ) { if ( ( handle ) == 0 ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( string == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; int cairo = data . cairo ; if ( cairo != 0 ) { if ( ( OS . GTK_VERSION ) < ( OS . VERSION ( 2 , 8 , 0 ) ) ) { checkGC ( GC . FONT ) ; byte [ ] buffer = Converter . wcsToMbcs ( null , string , true ) ; cairo_font_extents_t font_extents = new cairo_font_extents_t ( ) ; Cairo . cairo_font_extents ( cairo , font_extents ) ; cairo_text_extents_t extents = new cairo_text_extents_t ( ) ; Cairo . cairo_text_extents ( cairo , buffer , extents ) ; return new Point ( ( ( int ) ( extents . width ) ) , ( ( int ) ( font_extents . height ) ) ) ; } } setString ( string , flags ) ; checkGC ( GC . FONT ) ; <START_BUG> if ( ( data . stringWidth ) != ( - 1 ) ) { <END_BUG> computeStringSize ( ) ; } return new Point ( data . stringWidth , data . stringHeight ) ; } public String toString ( ) { } }

Fix:
if ( ( data . stringWidth ) == ( - 1 ) ) {