lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Excessive use of ensureOpen()
Date Sat, 20 Jun 2009 18:10:15 GMT
Hi

I noticed both IndexReader and IndexWriter call ensureOpen in almost every
method. How critical is this check? Why would someone call any of these when
the writer or reader are close?

If we add isOpen() to both, then I think we can remove this code from
IndexWriter/Reader, and tell folks to use it if they don't know whether the
instance they have in hands is open or close before they call any other
method.

What do you think? I can patch it up.

Shai

Mime
View raw message