Buggy code:
data . state &= ~ ( GC . BACKGROUND ) ; } else { foreground = data . background ; data . state &= ~ ( GC . FOREGROUND ) ; } OS . gdk_gc_set_foreground ( handle , foreground ) ; } if ( ( state & ( GC . BACKGROUND_BG ) ) != 0 ) { GdkColor background = data . background ; OS . gdk_gc_set_background ( handle , background ) ; } if ( ( state & ( GC . FONT ) ) != 0 ) { if ( ( data . layout ) != 0 ) { OS . pango_layout_set_font_description ( data . layout , data . font ) ; } } if ( ( state & ( ( ( ( GC . LINE_CAP ) | ( GC . LINE_JOIN ) ) | ( GC . LINE_STYLE ) ) | ( GC . LINE_WIDTH ) ) ) != 0 ) { int cap_style = 0 ; int join_style = 0 ; int width = ( ( int ) ( data . lineWidth ) ) ; int line_style = 0 ; float [ ] dashes = null ; switch ( data . lineCap ) { case SWT . CAP_ROUND : cap_style = OS . GDK_CAP_ROUND ; break ; case SWT . CAP_FLAT : cap_style = OS . GDK_CAP_BUTT ; break ; case SWT . CAP_SQUARE : cap_style = OS . GDK_CAP_PROJECTING ; break ; } switch ( data . lineJoin ) { case SWT . JOIN_ROUND : join_style = OS . GDK_JOIN_ROUND ; break ; case SWT . JOIN_MITER : join_style = OS . GDK_JOIN_MITER ; break ; case SWT . JOIN_BEVEL : join_style = OS . GDK_JOIN_BEVEL ; break ; } switch ( data . lineStyle ) { case SWT . LINE_SOLID : break ; case SWT . LINE_DASH : dashes = ( width != 0 ) ? GC . LINE_DASH : GC . LINE_DASH_ZERO ; break ; case SWT . LINE_DOT : dashes = ( width != 0 ) ? GC . LINE_DOT : GC . LINE_DOT_ZERO ; break ; case SWT . LINE_DASHDOT : dashes = ( width != 0 ) ? GC . LINE_DASHDOT : GC . LINE_DASHDOT_ZERO ; break ; case SWT . LINE_DASHDOTDOT : dashes = ( width != 0 ) ? GC . LINE_DASHDOTDOT : GC . LINE_DASHDOTDOT_ZERO ; break ; case SWT . LINE_CUSTOM : dashes = data . lineDashes ; break ; } if ( dashes != null ) { if ( ( state & ( GC . LINE_STYLE ) ) != 0 ) { byte [ ] dash_list = new byte [ dashes . length ] ; for ( int i = 0 ; i < ( dash_list . length ) ; i ++ ) { dash_list [ i ] = ( ( byte ) ( ( ( width == 0 ) || ( ( data . lineStyle ) == ( SWT . LINE_CUSTOM ) ) ) ? dashes [ i ] : ( dashes [ i ] ) * width ) ) ; } <START_BUG> OS . gdk_gc_set_dashes ( handle , ( - 1 ) , dash_list , dash_list . length ) ; <END_BUG> } line_style = OS . GDK_LINE_ON_OFF_DASH ; } else { line_style = OS . GDK_LINE_SOLID ; } OS . gdk_gc_set_line_attributes ( handle , width , line_style , cap_style , join_style ) ; } } int convertRgn ( int rgn , double [ ] matrix ) { } public void copyArea ( Image image , int x , int y ) { } 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 ) { } void createLayout ( ) { } void disposeLayout ( ) { } public void dispose ( ) { } 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 ) { } void drawImage ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , int imgWidth , int imgHeight ) { } void drawImageAlpha ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , int imgWidth , int imgHeight ) { } void drawImageMask ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , int imgWidth , int imgHeight ) { } void drawImageXRender ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , int imgWidth , int imgHeight , int maskPixmap , int maskType ) { } int scale ( int src , int srcX , int srcY , int srcWidth , int srcHeight , int destWidth , int destHeight ) { }

Fix:
OS . gdk_gc_set_dashes ( handle , 0 , dash_list , dash_list . length ) ;