[ 
http://issues.apache.org/jira/browse/LUCENE-632?page=comments#action_12430460 ] 
            
Miles Barr commented on LUCENE-632:
-----------------------------------

I've checked svn and it's not an issue in trunk, but it's definitely a bug in 
the version that's distributed with Lucene 1.9.1

The reader is only opened in the 'exist' method, but at the end of the 
'indexDictionary' method it tries to close the reader, then sets it to null. I 
think the intent of the code is to make sure we don't have an old reader after 
we update the dictionary, but if we're creating the dictionary for the first 
time we get a NPE.

The simple fix is to check if reader is null before trying to close it.

> The creation of a spell index from a LuceneDictionary via 
> SpellChecker.indexDictionary (Dictionary dict) fails starting with 1.9.1 (up 
> to current svn version)
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-632
>                 URL: http://issues.apache.org/jira/browse/LUCENE-632
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 1.9, 2.0.0
>            Reporter: Karsten Dello
>            Priority: Minor
>         Attachments: lazy_searcher.diff
>
>
> Two different errors in 1.9.1/2.0.0 and current svn version.
> 1.9.1/2.0.0:
> at the end of indexDictionary (Dictionary dict) 
> the IndexReader-instance reader is closed.
> This causes a NullpointerException because reader has not been initialized 
> before (neither in that method nor in the constructor).
> Uncommenting this line (reader.close()) seems to resolve that issue.
> current svn:
> the constructor tries to create an IndexSearcher-instance for the specified 
> path;
> as there is no index in that path - it is not created yet -  an exception is 
> thrown.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to