lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-818) IndexWriter should detect when it's used after being closed
Date Thu, 08 Mar 2007 18:08:24 GMT


Michael McCandless commented on LUCENE-818:

> I'm not enough of an expert to know if this would be faster or slower than a simple fileMap==null
> I would guess it depends on what needs to be set up in the stack frame to potentially
catch an exception, and if the try/catch/throw code prevents any optimizations (such as inlining).
> Also, catching a NPE seems a little icky to me... so w/o more info I'd lean toward a
fileMap==null check (if anything).

OK, good points.  It is not in fact clear that a try/catch solution is
less costly, so, let's keep it simple.  I will just add ensureOpen().

> IndexWriter should detect when it's used after being closed
> -----------------------------------------------------------
>                 Key: LUCENE-818
>                 URL:
>             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, LUCENE-818.take2.patch, LUCENE-818.take3.patch,
> Spinoff from this thread on java-user:
> 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:
For additional commands, e-mail:

View raw message