We should just let IW create a null commit on an empty directory, like it always did ;) Then a whole class of such problems disappears.
On Thu, Apr 15, 2010 at 11:16, Shai Erera <ser...@gmail.com> wrote: > SDP throws NPE if the index includes no commits, but snapshot() is called. > This is an extreme case, but can happen if one takes snapshots (for backup > purposes for example) in a separate code segment than indexing, and does not > know if commit was called or not. > > I think we should throw an IllegalStateException instead of falling on NPE, > w/ a descriptive message. Alternatively, we can just return null and > document it ... But I prefer the ISE instead. What do you think? > > Shai > -- Kirill Zakharenko/Кирилл Захаренко (ear...@gmail.com) Home / Mobile: +7 (495) 683-567-4 / +7 (903) 5-888-423 ICQ: 104465785 --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org