Buggy code:
@ Signature private Memory __construct ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( value = "image" , typeClass = ( SwingExtension . NAMESPACE ) + "Image" ) , @ Arg ( value = "x" , optional = @ Optional ( value = "0" , type = HintType . INT ) ) , @ Arg ( value = "y" , optional = @ Optional ( value = "0" , type = HintType . INT ) ) , @ Arg ( value = "newWidth" , optional = @ Optional ( "NULL" ) ) , @ Arg ( value = "newHeight" , optional = @ Optional ( "NULL" ) ) } ) public Memory drawImage ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x1" ) , @ Arg ( "y1" ) , @ Arg ( "x2" ) , @ Arg ( "y2" ) } ) public Memory drawLine ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) } ) public Memory drawRect ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) } ) public Memory fillRect ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) , @ Arg ( "raised" ) } ) public Memory draw3DRect ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) , @ Arg ( "raised" ) } ) public Memory fill3DRect ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) , @ Arg ( "startAngle" ) , @ Arg ( "arcAngle" ) } ) public Memory drawArc ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) , @ Arg ( "startAngle" ) , @ Arg ( "arcAngle" ) } ) public Memory fillArc ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) } ) public Memory drawOval ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "x" ) , @ Arg ( "y" ) , @ Arg ( "width" ) , @ Arg ( "height" ) } ) public Memory fillOval ( Environment env , Memory ... args ) { } @ Signature ( { @ Arg ( "text" ) , @ Arg ( "x" ) , @ Arg ( "y" ) } ) public Memory drawText ( Environment env , Memory ... args ) { } protected static Polygon toPolygon ( Environment env , ArrayMemory arr ) { int npoints = arr . size ( ) ; int [ ] xPoints = new int [ npoints ] ; int [ ] yPoints = new int [ npoints ] ; int i = 0 ; for ( Memory el : arr . values ( ) ) { if ( ! ( el . isArray ( ) ) ) env . exception ( "Polygon<seq2seq4repair_space>must<seq2seq4repair_space>contain<seq2seq4repair_space>only<seq2seq4repair_space>array<seq2seq4repair_space>type<seq2seq4repair_space>elements,<seq2seq4repair_space>given<seq2seq4repair_space>" , el . getRealType ( ) . toString ( ) ) ; else { Memory [ ] xy = el . toValue ( ArrayMemory . class ) . values ( ) ; if ( ( xy . length ) < 2 ) env . exception ( "Polygon:<seq2seq4repair_space>invalid<seq2seq4repair_space>element<seq2seq4repair_space>count<seq2seq4repair_space>of<seq2seq4repair_space>array<seq2seq4repair_space>item<seq2seq4repair_space>-<seq2seq4repair_space>%s" , xy . length ) ; xPoints [ i ] = xy [ 0 ] . toInteger ( ) ; <START_BUG> yPoints [ i ] = xy [ 0 ] . toInteger ( ) ; <END_BUG> } i ++ ; } return new Polygon ( xPoints , yPoints , npoints ) ; } @ Signature ( @ Arg ( value = "polygon" , type = HintType . ARRAY ) ) public Memory drawPolygon ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( value = "polygon" , type = HintType . ARRAY ) ) public Memory fillPolygon ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( value = "polyline" , type = HintType . ARRAY ) ) public Memory drawPolyline ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( "color" ) ) public Memory setXORMode ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( "str" ) ) public Memory getTextWidth ( Environment env , Memory ... args ) { } @ Signature public Memory getTextHeight ( Environment env , Memory ... args ) { } @ Signature public Memory dispose ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( "color" ) ) public Memory __setColor ( Environment env , Memory ... args ) { } @ Signature public Memory __getColor ( Environment env , Memory ... args ) { } @ Signature ( @ Arg ( "font" ) ) public Memory __setFont ( Environment env , Memory ... args ) { } @ Signature public Memory __getFont ( Environment env , Memory ... args ) { }

Fix:
yPoints [ i ] = xy [ 1 ] . toInteger ( ) ;