Buggy code:
@ Ignore public abstract class FunctionTestSetup extends LuceneTestCase { protected static float TEST_SCORE_TOLERANCE_DELTA = 0.001F ; 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" ; protected ValueSource BYTE_VALUESOURCE = new ByteFieldSource ( FunctionTestSetup . INT_FIELD ) ; protected ValueSource SHORT_VALUESOURCE = new ShortFieldSource ( FunctionTestSetup . INT_FIELD ) ; protected ValueSource INT_VALUESOURCE = new IntFieldSource ( FunctionTestSetup . INT_FIELD ) ; protected ValueSource INT_AS_FLOAT_VALUESOURCE = new FloatFieldSource ( FunctionTestSetup . INT_FIELD ) ; protected ValueSource FLOAT_VALUESOURCE = new FloatFieldSource ( FunctionTestSetup . FLOAT_FIELD ) ; 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 static Directory dir ; protected static Analyzer anlzr ; @ AfterClass public static void afterClassFunctionTestSetup ( ) throws Exception { } protected static void createIndex ( boolean doMultiSegment ) throws Exception { } private static void addDoc ( RandomIndexWriter iw , int i ) throws Exception { Document d = new Document ( ) ; Field f ; int scoreAndID = i + 1 ; FieldType customType = new FieldType ( TextField . TYPE_STORED ) ; customType . setTokenized ( false ) ; customType . setOmitNorms ( true ) ; f = newField ( FunctionTestSetup . ID_FIELD , FunctionTestSetup . id2String ( scoreAndID ) , customType ) ; d . add ( f ) ; <START_BUG> FieldType customType2 = new FieldType ( TextField . TYPE_UNSTORED ) ; <END_BUG> customType2 . setOmitNorms ( true ) ; f = newField ( FunctionTestSetup . TEXT_FIELD , ( ( "text<seq2seq4repair_space>of<seq2seq4repair_space>doc" + scoreAndID ) + ( FunctionTestSetup . textLine ( i ) ) ) , customType2 ) ; d . add ( f ) ; f = newField ( FunctionTestSetup . INT_FIELD , ( "" + scoreAndID ) , customType ) ; d . add ( f ) ; f = newField ( FunctionTestSetup . FLOAT_FIELD , ( scoreAndID + ".000" ) , customType ) ; d . add ( f ) ; iw . addDocument ( d ) ; FunctionTestSetup . log ( ( "added:<seq2seq4repair_space>" + d ) ) ; } protected static String id2String ( int scoreAndID ) { } private static String textLine ( int docNum ) { } protected static float expectedFieldScore ( String docIDFieldVal ) { } protected static void log ( Object o ) { } }

Fix:
FieldType customType2 = new FieldType ( TextField . TYPE_NOT_STORED ) ;