You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2007/03/02 19:19:51 UTC
[jira] Updated: (LUCENE-818) IndexWriter should detect when it's
used after being closed
[ https://issues.apache.org/jira/browse/LUCENE-818?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael McCandless updated LUCENE-818:
--------------------------------------
Attachment: LUCENE-818.patch
Attached patch.
I added checks to all public methods in IndexReader (and its
subclasses in Lucene's sources: SegmentReader, MultiReader,
FilteredIndexReader, ParallelReader), IndexWriter and FieldsReader
that throw AlreadyClosedException if they are used after being closed.
I then hit a few tests that were incorrectly closing
reader/searcher/writer and then continuing to use them (or double
closing them), so I fixed those.
> IndexWriter should detect when it's used after being closed
> -----------------------------------------------------------
>
> Key: LUCENE-818
> URL: https://issues.apache.org/jira/browse/LUCENE-818
> Project: Lucene - Java
> Issue Type: Bug
> Components: Index
> Affects Versions: 2.1
> Reporter: Michael McCandless
> Assigned To: Michael McCandless
> Priority: Minor
> Attachments: LUCENE-818.patch
>
>
> Spinoff from this thread on java-user:
> http://www.gossamer-threads.com/lists/lucene/java-user/45986
> If you call addDocument on IndexWriter after it's closed you'll hit a
> hard-to-explain NullPointerException (because the RAMDirectory was
> closed). Before 2.1, apparently you won't hit any exception and the
> IndexWrite will keep running but will have released it's write lock (I
> think).
> I plan to fix IndexWriter methods to throw an IllegalStateException if
> it has been closed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org