Buggy code:
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 ) { } void drawText ( int x , int y , int start , int length , 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 ) { } void flush ( ) { } public int getAdvanceWidth ( char ch ) { } public Color getBackground ( ) { } public Pattern getBackgroundPattern ( ) { } public int getAlpha ( ) { } public int getAntialias ( ) { } 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 int getInterpolation ( ) { } 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 ( ) { } void init ( Drawable drawable , GCData data , int context ) { } public boolean isClipped ( ) { } public boolean isDisposed ( ) { } boolean isIdentity ( float [ ] transform ) { } public void setAlpha ( int alpha ) { } public void setAntialias ( int antialias ) { } public void setBackground ( Color color ) { } public void setBackgroundPattern ( Pattern pattern ) { } 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 ) { } void setCGClipping ( ) { } public void setFillRule ( int rule ) { } public void setFont ( Font font ) { } void setGCFont ( ) { } public void setForeground ( Color color ) { } public void setForegroundPattern ( Pattern pattern ) { } public void setInterpolation ( int interpolation ) { } public void setLineCap ( int cap ) { } public void setLineDash ( int [ ] dashes ) { } public void setLineJoin ( int join ) { } public void setLineStyle ( int lineStyle ) { } public void setLineWidth ( int width ) { if ( ( handle ) == 0 ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; data . lineWidth = width ; <START_BUG> OS . CGContextSetLineWidth ( handle , width ) ; <END_BUG> } int setString ( String string , int flags ) { } public void setXORMode ( boolean xor ) { } int regionToRects ( int message , int rgn , int r , int newRgn ) { } public void setTextAntialias ( int antialias ) { } public void setTransform ( Transform transform ) { } public Point stringExtent ( String string ) { } public Point textExtent ( String string ) { } public Point textExtent ( String string , int flags ) { } public String toString ( ) { } }

Fix:
OS . CGContextSetLineWidth ( handle , Math . max ( 1 , width ) ) ;