Buggy code:
@ Deprecated class Lucene3xFieldInfosReader extends FieldInfosReader { static final String FIELD_INFOS_EXTENSION = "fnm" ; static final int FORMAT_START = - 2 ; static final int FORMAT_OMIT_POSITIONS = - 3 ; static final int FORMAT_MINIMUM = Lucene3xFieldInfosReader . FORMAT_START ; static final int FORMAT_CURRENT = Lucene3xFieldInfosReader . FORMAT_OMIT_POSITIONS ; static final byte IS_INDEXED = 1 ; static final byte STORE_TERMVECTOR = 2 ; static final byte OMIT_NORMS = 16 ; static final byte STORE_PAYLOADS = 32 ; static final byte OMIT_TERM_FREQ_AND_POSITIONS = 64 ; static final byte OMIT_POSITIONS = - 128 ; @ Override public FieldInfos read ( Directory directory , String segmentName , IOContext iocontext ) throws IOException { final String fileName = IndexFileNames . segmentFileName ( segmentName , "" , Lucene3xFieldInfosReader . FIELD_INFOS_EXTENSION ) ; IndexInput input = directory . openInput ( fileName , iocontext ) ; boolean hasVectors = false ; boolean hasFreq = false ; boolean hasProx = false ; try { final int format = input . readVInt ( ) ; if ( format > ( Lucene3xFieldInfosReader . FORMAT_MINIMUM ) ) { throw new org . apache . lucene . index . IndexFormatTooOldException ( input , format , Lucene3xFieldInfosReader . FORMAT_MINIMUM , Lucene3xFieldInfosReader . FORMAT_CURRENT ) ; } if ( format < ( Lucene3xFieldInfosReader . FORMAT_CURRENT ) ) { throw new org . apache . lucene . index . IndexFormatTooNewException ( input , format , Lucene3xFieldInfosReader . FORMAT_MINIMUM , Lucene3xFieldInfosReader . FORMAT_CURRENT ) ; } final int size = input . readVInt ( ) ; FieldInfo [ ] infos = new FieldInfo [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { String name = input . readString ( ) ; final int fieldNumber = i ; byte bits = input . readByte ( ) ; boolean isIndexed = ( bits & ( Lucene3xFieldInfosReader . IS_INDEXED ) ) != 0 ; boolean storeTermVector = ( bits & ( Lucene3xFieldInfosReader . STORE_TERMVECTOR ) ) != 0 ; boolean omitNorms = ( bits & ( Lucene3xFieldInfosReader . OMIT_NORMS ) ) != 0 ; boolean storePayloads = ( bits & ( Lucene3xFieldInfosReader . STORE_PAYLOADS ) ) != 0 ; final IndexOptions indexOptions ; if ( ( bits & ( Lucene3xFieldInfosReader . OMIT_TERM_FREQ_AND_POSITIONS ) ) != 0 ) { indexOptions = IndexOptions . DOCS_ONLY ; } else if ( ( bits & ( Lucene3xFieldInfosReader . OMIT_POSITIONS ) ) != 0 ) { if ( format <= ( Lucene3xFieldInfosReader . FORMAT_OMIT_POSITIONS ) ) { indexOptions = IndexOptions . DOCS_AND_FREQS ; } else { throw new org . apache . lucene . index . CorruptIndexException ( ( ( ( ( "Corrupt<seq2seq4repair_space>fieldinfos,<seq2seq4repair_space>OMIT_POSITIONS<seq2seq4repair_space>set<seq2seq4repair_space>but<seq2seq4repair_space>format=" + format ) + "<seq2seq4repair_space>(resource:<seq2seq4repair_space>" ) + input ) + ")" ) ) ; } } else { indexOptions = IndexOptions . DOCS_AND_FREQS_AND_POSITIONS ; } if ( indexOptions != ( IndexOptions . DOCS_AND_FREQS_AND_POSITIONS ) ) { storePayloads = false ; } hasVectors |= storeTermVector ; hasProx |= isIndexed && ( indexOptions == ( IndexOptions . DOCS_AND_FREQS_AND_POSITIONS ) ) ; hasFreq |= isIndexed && ( indexOptions != ( IndexOptions . DOCS_ONLY ) ) ; <START_BUG> infos [ i ] = new FieldInfo ( name , isIndexed , fieldNumber , storeTermVector , omitNorms , storePayloads , indexOptions , null , ( isIndexed && ( ! omitNorms ) ? Type . BYTES_VAR_STRAIGHT : null ) ) ; <END_BUG> } if ( ( input . getFilePointer ( ) ) != ( input . length ( ) ) ) { throw new org . apache . lucene . index . CorruptIndexException ( ( ( ( ( ( ( ( ( "did<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>all<seq2seq4repair_space>bytes<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>\"" + fileName ) + "\":<seq2seq4repair_space>read<seq2seq4repair_space>" ) + ( input . getFilePointer ( ) ) ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>size<seq2seq4repair_space>" ) + ( input . length ( ) ) ) + "<seq2seq4repair_space>(resource:<seq2seq4repair_space>" ) + input ) + ")" ) ) ; } return new FieldInfos ( infos , hasFreq , hasProx , hasVectors ) ; } finally { input . close ( ) ; } } public static void files ( SegmentInfo info , Set < String > files ) throws IOException { } }

Fix:
infos [ i ] = new FieldInfo ( name , isIndexed , fieldNumber , storeTermVector , omitNorms , storePayloads , indexOptions , null , ( isIndexed && ( ! omitNorms ) ? Type . FIXED_INTS_8 : null ) ) ;