Buggy code:
public class FileFloatSource extends ValueSource { private SchemaField field ; private final SchemaField keyField ; private final float defVal ; private final String dataDir ; public FileFloatSource ( SchemaField field , SchemaField keyField , float defVal , QParser parser ) { } @ Override public String description ( ) { } @ Override public DocValues getValues ( Map context , IndexReader reader ) throws IOException { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } public static void resetCache ( ) { } private final float [ ] getCachedFloats ( IndexReader reader ) { } static FileFloatSource . Cache floatCache = new FileFloatSource . Cache ( ) { @ Override protected Object createValue ( IndexReader reader , Object key ) { } } ; abstract static class Cache { private final Map readerCache = new WeakHashMap ( ) ; protected abstract Object createValue ( IndexReader reader , Object key ) { } public Object get ( IndexReader reader , Object key ) { } public void resetCache ( ) { } } static Object onlyForTesting ; static final class CreationPlaceholder { Object value ; } private static class Entry { final FileFloatSource ffs ; public Entry ( FileFloatSource ffs ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } private static float [ ] getFloats ( FileFloatSource ffs , IndexReader reader ) { float [ ] vals = new float [ reader . maxDoc ( ) ] ; if ( ( ffs . defVal ) != 0 ) { Arrays . fill ( vals , ffs . defVal ) ; } InputStream is ; String fname = "external_" + ( ffs . field . getName ( ) ) ; try { is = VersionedFile . getLatestFile ( ffs . dataDir , fname ) ; } catch ( IOException e ) { log . error ( ( "Error<seq2seq4repair_space>opening<seq2seq4repair_space>external<seq2seq4repair_space>value<seq2seq4repair_space>source<seq2seq4repair_space>file:<seq2seq4repair_space>" + e ) ) ; return vals ; } BufferedReader r = new BufferedReader ( new InputStreamReader ( is ) ) ; String idName = StringHelper . intern ( ffs . keyField . getName ( ) ) ; FieldType idType = ffs . keyField . getType ( ) ; boolean sorted = true ; List < String > notFound = new ArrayList < String > ( ) ; int notFoundCount = 0 ; int otherErrors = 0 ; TermDocs termDocs = null ; Term protoTerm = new Term ( idName , "" ) ; TermEnum termEnum = null ; int numTimesNext = 10 ; char delimiter = '=' ; String termVal ; boolean hasNext = true ; String prevKey = "" ; String lastVal = "￿￿￿￿￿￿￿￿" ; try { termDocs = reader . termDocs ( ) ; termEnum = reader . terms ( protoTerm ) ; Term t = termEnum . term ( ) ; if ( ( t != null ) && ( ( t . field ( ) ) == idName ) ) { termVal = t . text ( ) ; } else { termVal = lastVal ; } for ( String line ; ( line = r . readLine ( ) ) != null ; ) { <START_BUG> int delimIndex = line . indexOf ( delimiter ) ; <END_BUG> if ( delimIndex < 0 ) continue ; int endIndex = line . length ( ) ; String key = line . substring ( 0 , delimIndex ) ; String val = line . substring ( ( delimIndex + 1 ) , endIndex ) ; String internalKey = idType . toInternal ( key ) ; float fval ; try { fval = Float . parseFloat ( val ) ; } catch ( Exception e ) { if ( ( ++ otherErrors ) <= 10 ) { log . error ( ( ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>external<seq2seq4repair_space>value<seq2seq4repair_space>source<seq2seq4repair_space>+<seq2seq4repair_space>fileName<seq2seq4repair_space>+<seq2seq4repair_space>" + e ) + ( otherErrors < 10 ? "" : "\tSkipping<seq2seq4repair_space>future<seq2seq4repair_space>errors<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>file." ) ) ) ; } continue ; } if ( sorted ) { sorted = ( internalKey . compareTo ( prevKey ) ) >= 0 ; prevKey = internalKey ; if ( sorted ) { int countNext = 0 ; for ( ; ; ) { int cmp = internalKey . compareTo ( termVal ) ; if ( cmp == 0 ) { termDocs . seek ( termEnum ) ; while ( termDocs . next ( ) ) { vals [ termDocs . doc ( ) ] = fval ; } break ; } else if ( cmp < 0 ) { if ( notFoundCount < 10 ) { notFound . add ( key ) ; } notFoundCount ++ ; break ; } else { if ( ( ++ countNext ) > numTimesNext ) { termEnum = reader . terms ( protoTerm . createTerm ( internalKey ) ) ; t = termEnum . term ( ) ; } else { hasNext = termEnum . next ( ) ; t = ( hasNext ) ? termEnum . term ( ) : null ; } if ( ( t != null ) && ( ( t . field ( ) ) == idName ) ) { termVal = t . text ( ) ; } else { termVal = lastVal ; } } } } } if ( ! sorted ) { termEnum = reader . terms ( protoTerm . createTerm ( internalKey ) ) ; t = termEnum . term ( ) ; if ( ( ( t != null ) && ( ( t . field ( ) ) == idName ) ) && ( internalKey . equals ( t . text ( ) ) ) ) { termDocs . seek ( termEnum ) ; while ( termDocs . next ( ) ) { vals [ termDocs . doc ( ) ] = fval ; } }

Fix:
int delimIndex = line . lastIndexOf ( delimiter ) ;