[ 
https://issues.apache.org/jira/browse/LUCENE-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael McCandless resolved LUCENE-2334.
----------------------------------------

    Resolution: Won't Fix
    
> IndexReader.close() should call IndexReader.decRef() unconditionally ??
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-2334
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2334
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/index
>    Affects Versions: 3.0.1
>            Reporter: Mike Hanafey
>            Priority: Minor
>
> IndexReader.close() is defined:
> {code}  /**
>    * Closes files associated with this index.
>    * Also saves any new deletions to disk.
>    * No other methods should be called after this has been called.
>    * @throws IOException if there is a low-level IO error
>    */
>   public final synchronized void close() throws IOException {
>     if (!closed) {
>       decRef();
>       closed = true;
>     }
>   }
> {code}
> This  means that  if the refCount is bigger than one, close() does not 
> actually close, but it is also true that calling close() again has no effect.
> Why does close() not simply call decRef() unconditionally? This way if 
> incRef() is called each time an instance of IndexReader were handed out, if 
> close() is called by each recipient when they are done, the last one to call 
> close will actually close the index. As written it seems the API is very 
> confusing -- the first close() does one thing, but the next close() does 
> something different.
> At a minimum the JavaDoc should clarify the behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to