lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject SnapshotDeletionPolicy throws NPE if no commit happened
Date Thu, 15 Apr 2010 07:16:25 GMT
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

Mime
View raw message