Buggy code:
public class Snippet203 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; final Shell shell = new Shell ( display , ( ( SWT . SHELL_TRIM ) | ( SWT . DOUBLE_BUFFERED ) ) ) ; String [ ] texts = new String [ ] { "Plans<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>materialize<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>nowhere,<seq2seq4repair_space>nor<seq2seq4repair_space>are<seq2seq4repair_space>they<seq2seq4repair_space>entirely<seq2seq4repair_space>static.<seq2seq4repair_space>To<seq2seq4repair_space>ensure<seq2seq4repair_space>the<seq2seq4repair_space>planning<seq2seq4repair_space>process<seq2seq4repair_space>is<seq2seq4repair_space>transparent<seq2seq4repair_space>and<seq2seq4repair_space>open<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>entire<seq2seq4repair_space>Eclipse<seq2seq4repair_space>community,<seq2seq4repair_space>we<seq2seq4repair_space>(the<seq2seq4repair_space>Eclipse<seq2seq4repair_space>PMC)<seq2seq4repair_space>post<seq2seq4repair_space>plans<seq2seq4repair_space>in<seq2seq4repair_space>an<seq2seq4repair_space>embryonic<seq2seq4repair_space>form<seq2seq4repair_space>and<seq2seq4repair_space>revise<seq2seq4repair_space>them<seq2seq4repair_space>throughout<seq2seq4repair_space>the<seq2seq4repair_space>release<seq2seq4repair_space>cycle." , "The<seq2seq4repair_space>first<seq2seq4repair_space>part<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>plan<seq2seq4repair_space>deals<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>important<seq2seq4repair_space>matters<seq2seq4repair_space>of<seq2seq4repair_space>release<seq2seq4repair_space>deliverables,<seq2seq4repair_space>release<seq2seq4repair_space>milestones,<seq2seq4repair_space>target<seq2seq4repair_space>operating<seq2seq4repair_space>environments,<seq2seq4repair_space>and<seq2seq4repair_space>release-to-release<seq2seq4repair_space>compatibility.<seq2seq4repair_space>These<seq2seq4repair_space>are<seq2seq4repair_space>all<seq2seq4repair_space>things<seq2seq4repair_space>that<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>clear<seq2seq4repair_space>for<seq2seq4repair_space>any<seq2seq4repair_space>release,<seq2seq4repair_space>even<seq2seq4repair_space>if<seq2seq4repair_space>no<seq2seq4repair_space>features<seq2seq4repair_space>were<seq2seq4repair_space>to<seq2seq4repair_space>change." , "The<seq2seq4repair_space>remainder<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>plan<seq2seq4repair_space>consists<seq2seq4repair_space>of<seq2seq4repair_space>plan<seq2seq4repair_space>items<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>various<seq2seq4repair_space>Eclipse<seq2seq4repair_space>subprojects.<seq2seq4repair_space>Each<seq2seq4repair_space>plan<seq2seq4repair_space>item<seq2seq4repair_space>covers<seq2seq4repair_space>a<seq2seq4repair_space>feature<seq2seq4repair_space>or<seq2seq4repair_space>API<seq2seq4repair_space>that<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>Eclipse,<seq2seq4repair_space>or<seq2seq4repair_space>some<seq2seq4repair_space>aspect<seq2seq4repair_space>of<seq2seq4repair_space>Eclipse<seq2seq4repair_space>that<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>improved.<seq2seq4repair_space>Each<seq2seq4repair_space>plan<seq2seq4repair_space>item<seq2seq4repair_space>has<seq2seq4repair_space>its<seq2seq4repair_space>own<seq2seq4repair_space>entry<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>Eclipse<seq2seq4repair_space>bugzilla<seq2seq4repair_space>database,<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>title<seq2seq4repair_space>and<seq2seq4repair_space>a<seq2seq4repair_space>concise<seq2seq4repair_space>summary<seq2seq4repair_space>(usually<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>paragraph)<seq2seq4repair_space>that<seq2seq4repair_space>explains<seq2seq4repair_space>the<seq2seq4repair_space>work<seq2seq4repair_space>item<seq2seq4repair_space>at<seq2seq4repair_space>a<seq2seq4repair_space>suitably<seq2seq4repair_space>high<seq2seq4repair_space>enough<seq2seq4repair_space>level<seq2seq4repair_space>so<seq2seq4repair_space>that<seq2seq4repair_space>everyone<seq2seq4repair_space>can<seq2seq4repair_space>readily<seq2seq4repair_space>understand<seq2seq4repair_space>what<seq2seq4repair_space>the<seq2seq4repair_space>work<seq2seq4repair_space>item<seq2seq4repair_space>is<seq2seq4repair_space>without<seq2seq4repair_space>having<seq2seq4repair_space>to<seq2seq4repair_space>understand<seq2seq4repair_space>the<seq2seq4repair_space>nitty-gritty<seq2seq4repair_space>detail." } ; int [ ] alignments = new int [ ] { SWT . LEFT , SWT . CENTER , SWT . RIGHT } ; final TextLayout [ ] layouts = new TextLayout [ texts . length ] ; for ( int i = 0 ; i < ( layouts . length ) ; i ++ ) { TextLayout layout = new TextLayout ( display ) ; <START_BUG> layout . setText ( texts [ 0 ] ) ; <END_BUG> layout . setIndent ( 30 ) ; layout . setJustify ( true ) ; layout . setAlignment ( alignments [ i ] ) ; layouts [ i ] = layout ; } shell . addListener ( Paint , new Listener ( ) { public void handleEvent ( Event event ) { Point point = new Point ( 10 , 10 ) ; int width = ( shell . getClientArea ( ) . width ) - ( 2 * ( point . x ) ) ; for ( int i = 0 ; i < ( layouts . length ) ; i ++ ) { TextLayout layout = layouts [ i ] ; layout . setWidth ( width ) ; layout . draw ( event . gc , point . x , point . y ) ; point . y += ( layout . getBounds ( ) . height ) + 10 ; } } } ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } for ( int i = 0 ; i < ( layouts . length ) ; i ++ ) { layouts [ i ] . dispose ( ) ; } display . dispose ( ) ; } }

Fix:
layout . setText ( texts [ i ] ) ;