Buggy code:
public abstract class FunctionTestSetup extends LuceneTestCase { public static float TEST_SCORE_TOLERANCE_DELTA = 0.001F ; protected static final boolean DBG = false ; protected static final int N_DOCS = 17 ; protected static final String ID_FIELD = "id" ; protected static final String TEXT_FIELD = "text" ; protected static final String INT_FIELD = "iii" ; protected static final String FLOAT_FIELD = "fff" ; private static final String [ ] DOC_TEXT_LINES = new String [ ] { "Well,<seq2seq4repair_space>this<seq2seq4repair_space>is<seq2seq4repair_space>just<seq2seq4repair_space>some<seq2seq4repair_space>plain<seq2seq4repair_space>text<seq2seq4repair_space>we<seq2seq4repair_space>use<seq2seq4repair_space>for<seq2seq4repair_space>creating<seq2seq4repair_space>the<seq2seq4repair_space>" , "test<seq2seq4repair_space>documents.<seq2seq4repair_space>It<seq2seq4repair_space>used<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>text<seq2seq4repair_space>from<seq2seq4repair_space>an<seq2seq4repair_space>online<seq2seq4repair_space>collection<seq2seq4repair_space>" , "devoted<seq2seq4repair_space>to<seq2seq4repair_space>first<seq2seq4repair_space>aid,<seq2seq4repair_space>but<seq2seq4repair_space>if<seq2seq4repair_space>there<seq2seq4repair_space>was<seq2seq4repair_space>there<seq2seq4repair_space>an<seq2seq4repair_space>(online)<seq2seq4repair_space>lawyers<seq2seq4repair_space>" , "first<seq2seq4repair_space>aid<seq2seq4repair_space>collection<seq2seq4repair_space>with<seq2seq4repair_space>legal<seq2seq4repair_space>advices,<seq2seq4repair_space>\"it\"<seq2seq4repair_space>might<seq2seq4repair_space>have<seq2seq4repair_space>quite<seq2seq4repair_space>" , "probably<seq2seq4repair_space>advised<seq2seq4repair_space>one<seq2seq4repair_space>not<seq2seq4repair_space>to<seq2seq4repair_space>include<seq2seq4repair_space>\"it\"\'s<seq2seq4repair_space>text<seq2seq4repair_space>or<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>of<seq2seq4repair_space>" , "any<seq2seq4repair_space>other<seq2seq4repair_space>online<seq2seq4repair_space>collection<seq2seq4repair_space>in<seq2seq4repair_space>one's<seq2seq4repair_space>code,<seq2seq4repair_space>unless<seq2seq4repair_space>one<seq2seq4repair_space>has<seq2seq4repair_space>money<seq2seq4repair_space>" , "that<seq2seq4repair_space>one<seq2seq4repair_space>don't<seq2seq4repair_space>need<seq2seq4repair_space>and<seq2seq4repair_space>one<seq2seq4repair_space>is<seq2seq4repair_space>happy<seq2seq4repair_space>to<seq2seq4repair_space>donate<seq2seq4repair_space>for<seq2seq4repair_space>lawyers<seq2seq4repair_space>" , "charity.<seq2seq4repair_space>Anyhow<seq2seq4repair_space>at<seq2seq4repair_space>some<seq2seq4repair_space>point,<seq2seq4repair_space>rechecking<seq2seq4repair_space>the<seq2seq4repair_space>usage<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>text,<seq2seq4repair_space>" , "it<seq2seq4repair_space>became<seq2seq4repair_space>uncertain<seq2seq4repair_space>that<seq2seq4repair_space>this<seq2seq4repair_space>text<seq2seq4repair_space>is<seq2seq4repair_space>free<seq2seq4repair_space>to<seq2seq4repair_space>use,<seq2seq4repair_space>because<seq2seq4repair_space>" , "the<seq2seq4repair_space>web<seq2seq4repair_space>site<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>disclaimer<seq2seq4repair_space>of<seq2seq4repair_space>he<seq2seq4repair_space>eBook<seq2seq4repair_space>containing<seq2seq4repair_space>that<seq2seq4repair_space>text<seq2seq4repair_space>" , "was<seq2seq4repair_space>not<seq2seq4repair_space>responding<seq2seq4repair_space>anymore,<seq2seq4repair_space>and<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>time,<seq2seq4repair_space>in<seq2seq4repair_space>projGut,<seq2seq4repair_space>" , "searching<seq2seq4repair_space>for<seq2seq4repair_space>first<seq2seq4repair_space>aid<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>found<seq2seq4repair_space>that<seq2seq4repair_space>eBook<seq2seq4repair_space>as<seq2seq4repair_space>well.<seq2seq4repair_space>" , "So<seq2seq4repair_space>here<seq2seq4repair_space>we<seq2seq4repair_space>are,<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>perhaps<seq2seq4repair_space>much<seq2seq4repair_space>less<seq2seq4repair_space>interesting<seq2seq4repair_space>" , "text<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>test,<seq2seq4repair_space>but<seq2seq4repair_space>oh<seq2seq4repair_space>much<seq2seq4repair_space>much<seq2seq4repair_space>safer.<seq2seq4repair_space>" } ; protected Directory dir ; protected Analyzer anlzr ; public FunctionTestSetup ( String name ) { } @ Override protected void tearDown ( ) throws Exception { } @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; super . setUp ( ) ; dir = new RAMDirectory ( ) ; <START_BUG> anlzr = new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) ; <END_BUG> IndexWriter iw = new IndexWriter ( dir , anlzr , MaxFieldLength . LIMITED ) ; int remaining = FunctionTestSetup . N_DOCS ; boolean [ ] done = new boolean [ FunctionTestSetup . N_DOCS ] ; int i = 0 ; while ( remaining > 0 ) { if ( done [ i ] ) { throw new Exception ( ( ( "to<seq2seq4repair_space>set<seq2seq4repair_space>this<seq2seq4repair_space>test<seq2seq4repair_space>correctly<seq2seq4repair_space>N_DOCS=" + ( FunctionTestSetup . N_DOCS ) ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>primary<seq2seq4repair_space>and<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>2!" ) ) ; } addDoc ( iw , i ) ; done [ i ] = true ; i = ( i + 4 ) % ( FunctionTestSetup . N_DOCS ) ; remaining -- ; } iw . close ( ) ; } private void addDoc ( IndexWriter iw , int i ) throws Exception { } protected String id2String ( int scoreAndID ) { } private String textLine ( int docNum ) { } protected float expectedFieldScore ( String docIDFieldVal ) { } protected void log ( Object o ) { } }

Fix:
anlzr = new org . apache . lucene . analysis . standard . StandardAnalyzer ( TEST_VERSION_CURRENT ) ;