lucene-dev mailing list archives

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


Yonik Seeley commented on LUCENE-818:

If we aren't guaranteeing an exception be thrown after a close, why are we bothering to put
the exception in the method signature?

It's already apparent to everyone that using something after it's closed isn't good, so we
were just cleaning up the  error messages and making it easier to debug.  People shouldn't
have specific application logic for this exception... it should be treated as a program error.

IMO, listing the exception encourages people to catch it, suggests that they can depend on
the exception being thrown, and also makes it more difficult to remove it from certain methods
in the future.

> 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