Buggy code:
public abstract class FieldType extends FieldProperties { public static final Logger log = LoggerFactory . getLogger ( FieldType . class ) ; public static final String POLY_FIELD_SEPARATOR = "___" ; protected String typeName ; protected Map < String , String > args ; protected int trueProperties ; protected int falseProperties ; int properties ; public boolean isTokenized ( ) { } public boolean isMultiValued ( ) { } protected boolean hasProperty ( int p ) { } public boolean isPolyField ( ) { } public boolean multiValuedFieldCache ( ) { } protected void init ( IndexSchema schema , Map < String , String > args ) { } protected String getArg ( String n , Map < String , String > args ) { } void setArgs ( IndexSchema schema , Map < String , String > args ) { } protected void restrictProps ( int props ) { } public String getTypeName ( ) { } void setTypeName ( String typeName ) { } @ Override public String toString ( ) { } public IndexableField createField ( SchemaField field , Object value , float boost ) { } protected IndexableField createField ( String name , String val , org . apache . lucene . document . FieldType type , float boost ) { } public IndexableField [ ] createFields ( SchemaField field , Object value , float boost ) { } protected IndexOptions getIndexOptions ( SchemaField field , String internalVal ) { } public String toInternal ( String val ) { } public String toExternal ( IndexableField f ) { } public Object toObject ( IndexableField f ) { } public Object toObject ( SchemaField sf , BytesRef term ) { } public String indexedToReadable ( String indexedForm ) { } public CharsRef indexedToReadable ( BytesRef input , CharsRef output ) { <START_BUG> input . utf8ToChars ( output ) ; <END_BUG> return output ; } public String storedToReadable ( IndexableField f ) { } public String storedToIndexed ( IndexableField f ) { } public String readableToIndexed ( String val ) { } public void readableToIndexed ( CharSequence val , BytesRef result ) { } protected final class DefaultAnalyzer extends SolrAnalyzer { final int maxChars ; DefaultAnalyzer ( int maxChars ) { } @ Override public TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } protected Analyzer analyzer = new FieldType . DefaultAnalyzer ( 256 ) ; protected Analyzer queryAnalyzer = analyzer ; public Analyzer getAnalyzer ( ) { } public Analyzer getQueryAnalyzer ( ) { } private final String analyzerError = ( ( ( "FieldType:<seq2seq4repair_space>" + ( this . getClass ( ) . getSimpleName ( ) ) ) + "<seq2seq4repair_space>(" ) + ( typeName ) ) + ")<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>specifying<seq2seq4repair_space>an<seq2seq4repair_space>analyzer" ; public void setAnalyzer ( Analyzer analyzer ) { } public void setQueryAnalyzer ( Analyzer analyzer ) { } protected Similarity similarity ; public Similarity getSimilarity ( ) { } public void setSimilarity ( Similarity similarity ) { } protected String postingsFormat ; public String getPostingsFormat ( ) { } public abstract void write ( TextResponseWriter writer , String name , IndexableField f ) throws IOException { } public abstract SortField getSortField ( SchemaField field , boolean top ) { } protected SortField getStringSort ( SchemaField field , boolean reverse ) { } public ValueSource getValueSource ( SchemaField field , QParser parser ) { } public Query getRangeQuery ( QParser parser , SchemaField field , String part1 , String part2 , boolean minInclusive , boolean maxInclusive ) { } public Query getFieldQuery ( QParser parser , SchemaField field , String externalVal ) { } }

Fix:
UnicodeUtil . UTF8toUTF16 ( input , output ) ;