Buggy code:
public class Field implements IndexableField , StorableField { protected final FieldType type ; protected final String name ; protected Object fieldsData ; protected TokenStream tokenStream ; private transient TokenStream internalTokenStream ; private transient Field . ReusableStringReader internalReader ; protected float boost = 1.0F ; protected Field ( String name , FieldType type ) { } public Field ( String name , Reader reader , FieldType type ) { } public Field ( String name , TokenStream tokenStream , FieldType type ) { } public Field ( String name , byte [ ] value , FieldType type ) { } public Field ( String name , byte [ ] value , int offset , int length , FieldType type ) { } public Field ( String name , BytesRef bytes , FieldType type ) { } public Field ( String name , String value , FieldType type ) { } @ Override public String stringValue ( ) { } @ Override public Reader readerValue ( ) { } public TokenStream tokenStreamValue ( ) { } public void setStringValue ( String value ) { } public void setReaderValue ( Reader value ) { } public void setBytesValue ( byte [ ] value ) { } public void setBytesValue ( BytesRef value ) { if ( ! ( ( fieldsData ) instanceof BytesRef ) ) { throw new IllegalArgumentException ( ( ( "cannot<seq2seq4repair_space>change<seq2seq4repair_space>value<seq2seq4repair_space>type<seq2seq4repair_space>from<seq2seq4repair_space>" + ( fieldsData . getClass ( ) . getSimpleName ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>BytesRef" ) ) ; } if ( type . indexed ( ) ) { <START_BUG> throw new IllegalArgumentException ( "cannot<seq2seq4repair_space>set<seq2seq4repair_space>a<seq2seq4repair_space>Reader<seq2seq4repair_space>value<seq2seq4repair_space>on<seq2seq4repair_space>an<seq2seq4repair_space>indexed<seq2seq4repair_space>field" ) ; <END_BUG> } fieldsData = value ; } public void setByteValue ( byte value ) { } public void setShortValue ( short value ) { } public void setIntValue ( int value ) { } public void setLongValue ( long value ) { } public void setFloatValue ( float value ) { } public void setDoubleValue ( double value ) { } public void setTokenStream ( TokenStream tokenStream ) { } @ Override public String name ( ) { } @ Override public float boost ( ) { } public void setBoost ( float boost ) { } @ Override public Number numericValue ( ) { } @ Override public BytesRef binaryValue ( ) { } @ Override public String toString ( ) { } @ Override public FieldType fieldType ( ) { } @ Override public TokenStream tokenStream ( Analyzer analyzer ) throws IOException { } static final class ReusableStringReader extends Reader { private int pos = 0 ; private int size = 0 ; private String s = null ; void setValue ( String s ) { } @ Override public int read ( ) { } @ Override public int read ( char [ ] c , int off , int len ) { } @ Override public void close ( ) { } } static final class StringTokenStream extends TokenStream { private final CharTermAttribute termAttribute = addAttribute ( CharTermAttribute . class ) ; private final OffsetAttribute offsetAttribute = addAttribute ( OffsetAttribute . class ) ; private boolean used = false ; private String value = null ; StringTokenStream ( ) { } void setValue ( String value ) { } @ Override public boolean incrementToken ( ) { } @ Override public void end ( ) { } @ Override public void reset ( ) { } @ Override public void close ( ) { } } public static enum Store { YES , NO ; } }

Fix:
throw new IllegalArgumentException ( "cannot<seq2seq4repair_space>set<seq2seq4repair_space>a<seq2seq4repair_space>BytesRef<seq2seq4repair_space>value<seq2seq4repair_space>on<seq2seq4repair_space>an<seq2seq4repair_space>indexed<seq2seq4repair_space>field" ) ;