lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <>
Subject IndexReader.commit - question on call to deleter.deleteFiles()
Date Tue, 19 Dec 2006 21:09:22 GMT

Something in how Deleter is called by IndexReader.commit that I don't
understand: IndexReader.commit() starts with:
      if (deleter == null) {
        // In the MultiReader case, we share this deleter
        // across all SegmentReaders:
        setDeleter(new IndexFileDeleter(segmentInfos, directory)); //[A]
        deleter.deleteFiles(); //[B]
      if(directoryOwner){ //[C]
Isn't it wrong to delete anything by [B] before verifying ownership in [C]?
In fact, seems that [B] would do nothing, because after [A],
deleter.deletable is null.

So I think line [B] should be removed (at least for clarity), right?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message