lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Updated: (LUCENE-2496) NPE if you open IW with CREATE on an index with no segments file
Date Thu, 10 Jun 2010 20:45:12 GMT


Michael McCandless updated LUCENE-2496:

    Attachment: LUCENE-2496.patch

Simple fix -- just check if current segments file is null before trying to open it.  I was
also able to remove "seenIndexFiles" since we can instead use "currentSegmentsFile != null".

> NPE if you open IW with CREATE on an index with no segments file
> ----------------------------------------------------------------
>                 Key: LUCENE-2496
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-2496.patch
> I have a simple test case that hits this NPE:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at<init>(
>     [junit] 	at
>     [junit] 	at
>     [junit] 	at
>     [junit] 	at org.apache.lucene.index.IndexFileDeleter.<init>(
>     [junit] 	at org.apache.lucene.index.IndexWriter.<init>(
>     [junit] 	at org.apache.lucene.index.TestIndexWriter.testNoSegmentFile(
>     [junit] 	at org.apache.lucene.util.LuceneTestCase.runBare(
> {noformat}
> It happens if you have an aborted index, ie, there are segment files in there (*.frq,
*.tis, etc.) but no segments_N file, and then you try to open an IW with CREATE on that index.

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