Buggy code:
public class TokenInfoDictionaryBuilder { private int offset = 0 ; private String encoding = "euc-jp" ; private boolean normalizeEntries = false ; private Normalizer2 normalizer ; private DictionaryFormat format = DictionaryFormat . IPADIC ; public TokenInfoDictionaryBuilder ( DictionaryFormat format , String encoding , boolean normalizeEntries ) { } public TokenInfoDictionaryWriter build ( String dirname ) throws IOException { } public TokenInfoDictionaryWriter buildDictionary ( List < File > csvFiles ) throws IOException { TokenInfoDictionaryWriter dictionary = new TokenInfoDictionaryWriter ( ( ( 10 * 1024 ) * 1024 ) ) ; System . out . println ( "<seq2seq4repair_space>parse..." ) ; List < String [ ] > lines = new ArrayList < String [ ] > ( 400000 ) ; for ( File file : csvFiles ) { FileInputStream inputStream = new FileInputStream ( file ) ; Charset cs = Charset . forName ( encoding ) ; CharsetDecoder decoder = cs . newDecoder ( ) . onMalformedInput ( CodingErrorAction . REPORT ) . onUnmappableCharacter ( CodingErrorAction . REPORT ) ; InputStreamReader streamReader = new InputStreamReader ( inputStream , decoder ) ; BufferedReader reader = new BufferedReader ( streamReader ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { String [ ] entry = CSVUtil . parse ( line ) ; if ( ( entry . length ) < 13 ) { System . out . println ( ( "Entry<seq2seq4repair_space>in<seq2seq4repair_space>CSV<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid:<seq2seq4repair_space>" + line ) ) ; continue ; } String [ ] formatted = formatEntry ( entry ) ; lines . add ( formatted ) ; if ( normalizeEntries ) { if ( normalizer . isNormalized ( entry [ 0 ] ) ) { continue ; } String [ ] normalizedEntry = new String [ entry . length ] ; for ( int i = 0 ; i < ( entry . length ) ; i ++ ) { normalizedEntry [ i ] = normalizer . normalize ( entry [ i ] ) ; } formatted = formatEntry ( normalizedEntry ) ; lines . add ( formatted ) ; } } } System . out . println ( "<seq2seq4repair_space>sort..." ) ; Collections . sort ( lines , new Comparator < String [ ] > ( ) { public int compare ( String [ ] left , String [ ] right ) { return left [ 0 ] . compareTo ( right [ 0 ] ) ; } } ) ; System . out . println ( "<seq2seq4repair_space>encode..." ) ; PositiveIntOutputs fstOutput = PositiveIntOutputs . getSingleton ( true ) ; <START_BUG> Builder < Long > fstBuilder = new Builder < Long > ( INPUT_TYPE . BYTE2 , 0 , 0 , true , true , Integer . MAX_VALUE , fstOutput , null , true ) ; <END_BUG> IntsRef scratch = new IntsRef ( ) ; long ord = - 1 ; String lastValue = null ; for ( String [ ] entry : lines ) { int next = dictionary . put ( entry ) ; if ( next == ( offset ) ) { System . out . println ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>line:<seq2seq4repair_space>" + ( Arrays . toString ( entry ) ) ) ) ; continue ; } String token = entry [ 0 ] ; if ( ! ( token . equals ( lastValue ) ) ) { ord ++ ; lastValue = token ; scratch . grow ( token . length ( ) ) ; scratch . length = token . length ( ) ; for ( int i = 0 ; i < ( token . length ( ) ) ; i ++ ) { scratch . ints [ i ] = ( ( int ) ( token . charAt ( i ) ) ) ; } fstBuilder . add ( scratch , ord ) ; } dictionary . addMapping ( ( ( int ) ( ord ) ) , offset ) ; offset = next ; } final FST < Long > fst = fstBuilder . finish ( ) ; System . out . print ( ( ( ( ( ( ( "<seq2seq4repair_space>" + ( fst . getNodeCount ( ) ) ) + "<seq2seq4repair_space>nodes,<seq2seq4repair_space>" ) + ( fst . getArcCount ( ) ) ) + "<seq2seq4repair_space>arcs,<seq2seq4repair_space>" ) + ( fst . sizeInBytes ( ) ) ) + "<seq2seq4repair_space>bytes...<seq2seq4repair_space>" ) ) ; dictionary . setFST ( fst ) ; System . out . println ( "<seq2seq4repair_space>done" ) ; return dictionary ; } public String [ ] formatEntry ( String [ ] features ) { } }

Fix:
Builder < Long > fstBuilder = new Builder < Long > ( INPUT_TYPE . BYTE2 , 0 , 0 , true , true , Integer . MAX_VALUE , fstOutput , null , true , true ) ;