Buggy code:
public class DirectoryTaxonomyWriter implements TaxonomyWriter { public static final String INDEX_CREATE_TIME = "index.create.time" ; private IndexWriter indexWriter ; private int nextID ; private char delimiter = Consts . DEFAULT_DELIMITER ; private DirectoryTaxonomyWriter . SinglePositionTokenStream parentStream = new DirectoryTaxonomyWriter . SinglePositionTokenStream ( Consts . PAYLOAD_PARENT ) ; private Field parentStreamField ; private Field fullPathField ; private TaxonomyWriterCache cache ; private boolean cacheIsComplete ; private DirectoryReader reader ; private int cacheMisses ; private final String createTime ; private static Map < String , String > readCommitData ( Directory dir ) throws IOException { } public void setDelimiter ( char delimiter ) { } public static void unlock ( Directory directory ) throws IOException { } public DirectoryTaxonomyWriter ( Directory directory , OpenMode openMode , TaxonomyWriterCache cache ) throws IOException { } protected IndexWriter openIndexWriter ( Directory directory , IndexWriterConfig config ) throws IOException { } protected IndexWriterConfig createIndexWriterConfig ( OpenMode openMode ) { } protected DirectoryReader openReader ( ) throws IOException { } public DirectoryTaxonomyWriter ( Directory directory , OpenMode openMode ) throws IOException , CorruptIndexException , LockObtainFailedException { } public static TaxonomyWriterCache defaultTaxonomyWriterCache ( ) { } public DirectoryTaxonomyWriter ( Directory d ) throws IOException , CorruptIndexException , LockObtainFailedException { } @ Override public synchronized void close ( ) throws IOException , CorruptIndexException { } private void doClose ( ) throws IOException , CorruptIndexException { } public int getCacheMemoryUsage ( ) { } protected synchronized void closeResources ( ) throws IOException { } protected int findCategory ( CategoryPath categoryPath ) throws IOException { } private int findCategory ( CategoryPath categoryPath , int prefixLen ) throws IOException { } @ Override public synchronized int addCategory ( CategoryPath categoryPath ) throws IOException { } private int internalAddCategory ( CategoryPath categoryPath , int length ) throws IOException , CorruptIndexException { } protected final void ensureOpen ( ) { } protected synchronized int addCategoryDocument ( CategoryPath categoryPath , int length , int parent ) throws IOException , CorruptIndexException { parentStream . set ( ( parent + 1 ) ) ; Document d = new Document ( ) ; d . add ( parentStreamField ) ; <START_BUG> fullPathField . setValue ( categoryPath . toString ( delimiter , length ) ) ; <END_BUG> d . add ( fullPathField ) ; indexWriter . addDocument ( d ) ; int id = ( nextID ) ++ ; addToCache ( categoryPath , length , id ) ; getParentArray ( ) . add ( id , parent ) ; return id ; } private static class SinglePositionTokenStream extends TokenStream { private CharTermAttribute termAtt ; private PositionIncrementAttribute posIncrAtt ; private boolean returned ; public SinglePositionTokenStream ( String word ) { } public void set ( int val ) { } @ Override public boolean incrementToken ( ) throws IOException { } } private void addToCache ( CategoryPath categoryPath , int id ) throws IOException , CorruptIndexException { } private void addToCache ( CategoryPath categoryPath , int prefixLen , int id ) throws IOException , CorruptIndexException { } protected synchronized void refreshReader ( ) throws IOException { } @ Override public synchronized void commit ( ) throws IOException , CorruptIndexException { } private Map < String , String > combinedCommitData ( Map < String , String > userData ) { } @ Override public synchronized void commit ( Map < String , String > commitUserData ) throws IOException , CorruptIndexException { } @ Override public synchronized void prepareCommit ( ) throws IOException , CorruptIndexException { } @ Override public synchronized void prepareCommit ( Map < String , String > commitUserData ) throws IOException , CorruptIndexException { } @ Override public synchronized int getSize ( ) { } private boolean alreadyCalledFillCache = false ; public void setCacheMissesUntilFill ( int i ) { } private int cacheMissesUntilFill = 11 ; private boolean perhapsFillCache ( ) throws IOException { } private ParentArray parentArray ; private synchronized ParentArray getParentArray ( ) throws IOException { } @ Override public int getParent ( int ordinal ) throws IOException { } public void addTaxonomies ( Directory [ ] taxonomies , DirectoryTaxonomyWriter . OrdinalMap [ ] ordinalMaps ) throws IOException { } DirectoryReader getInternalIndexReader ( ) { } public static interface OrdinalMap { public void setSize ( int size ) throws IOException { } public void addMapping ( int origOrdinal , int newOrdinal ) throws IOException { } public void addDone ( ) throws IOException { } public int [ ] getMap ( ) throws IOException { } } public static final class MemoryOrdinalMap implements DirectoryTaxonomyWriter . OrdinalMap { int [ ] map ; @ Override public void setSize ( int taxonomySize ) { } @ Override public void addMapping ( int origOrdinal , int newOrdinal ) { } @ Override public void addDone ( ) { } @ Override public int [ ] getMap ( ) { } } public static final class DiskOrdinalMap implements DirectoryTaxonomyWriter . OrdinalMap { File tmpfile ; DataOutputStream out ; public DiskOrdinalMap ( File tmpfile ) throws FileNotFoundException { } @ Override public void addMapping ( int origOrdinal , int newOrdinal ) throws IOException { } @ Override public void setSize ( int taxonomySize ) throws IOException { } @ Override public void addDone ( ) throws IOException { } int [ ] map = null ; @ Override public int [ ] getMap ( ) throws IOException { } } private static final String nextTE ( TermsEnum te ) throws IOException { } @ Override public synchronized void rollback ( ) throws IOException { } }

Fix:
fullPathField . setStringValue ( categoryPath . toString ( delimiter , length ) ) ;