You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Shai Erera <se...@gmail.com> on 2011/11/02 14:56:20 UTC
IndexReader.doOpenIfChanged javadocs
Hi
While migrating code which overrode IndexReader.reopen to override
IR.doOpenIfChanged, I ran into an issue that stemmed from the fact that
apparently doOpenIfChanged needs to return null if the IR wasn't reopened.
It'd help if it was documented :).
Is that the only contract of the method? I'd like to add some javadocs, so
please let me know if that's all that needs to be documented.
Shai
Re: IndexReader.doOpenIfChanged javadocs
Posted by Michael McCandless <lu...@mikemccandless.com>.
Thanks Shai!
Mike McCandless
http://blog.mikemccandless.com
On Thu, Nov 3, 2011 at 2:40 AM, Shai Erera <se...@gmail.com> wrote:
> Thanks Mike.
>
> I will add this javadoc text:
>
> /**
> * If the index has changed since it was opened, open and return a new
> reader;
> * else, return {@code null}.
> *
> * @see #openIfChanged(IndexReader)
> */
>
> I'll add similar text to the other doOpenIfChanged variants.
>
> Shai
>
> On Wed, Nov 2, 2011 at 3:59 PM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>>
>> Good point Shai!
>>
>> Yes, it must return null if there were no changes; else it must return
>> a new reader (!= this).
>>
>> Thanks.
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>> On Wed, Nov 2, 2011 at 9:56 AM, Shai Erera <se...@gmail.com> wrote:
>> > Hi
>> >
>> > While migrating code which overrode IndexReader.reopen to override
>> > IR.doOpenIfChanged, I ran into an issue that stemmed from the fact that
>> > apparently doOpenIfChanged needs to return null if the IR wasn't
>> > reopened.
>> > It'd help if it was documented :).
>> >
>> > Is that the only contract of the method? I'd like to add some javadocs,
>> > so
>> > please let me know if that's all that needs to be documented.
>> >
>> > Shai
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: IndexReader.doOpenIfChanged javadocs
Posted by Shai Erera <se...@gmail.com>.
Thanks Mike.
I will add this javadoc text:
/**
* If the index has changed since it was opened, open and return a new
reader;
* else, return {@code null}.
*
* @see #openIfChanged(IndexReader)
*/
I'll add similar text to the other doOpenIfChanged variants.
Shai
On Wed, Nov 2, 2011 at 3:59 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:
> Good point Shai!
>
> Yes, it must return null if there were no changes; else it must return
> a new reader (!= this).
>
> Thanks.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Wed, Nov 2, 2011 at 9:56 AM, Shai Erera <se...@gmail.com> wrote:
> > Hi
> >
> > While migrating code which overrode IndexReader.reopen to override
> > IR.doOpenIfChanged, I ran into an issue that stemmed from the fact that
> > apparently doOpenIfChanged needs to return null if the IR wasn't
> reopened.
> > It'd help if it was documented :).
> >
> > Is that the only contract of the method? I'd like to add some javadocs,
> so
> > please let me know if that's all that needs to be documented.
> >
> > Shai
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>
Re: IndexReader.doOpenIfChanged javadocs
Posted by Michael McCandless <lu...@mikemccandless.com>.
Good point Shai!
Yes, it must return null if there were no changes; else it must return
a new reader (!= this).
Thanks.
Mike McCandless
http://blog.mikemccandless.com
On Wed, Nov 2, 2011 at 9:56 AM, Shai Erera <se...@gmail.com> wrote:
> Hi
>
> While migrating code which overrode IndexReader.reopen to override
> IR.doOpenIfChanged, I ran into an issue that stemmed from the fact that
> apparently doOpenIfChanged needs to return null if the IR wasn't reopened.
> It'd help if it was documented :).
>
> Is that the only contract of the method? I'd like to add some javadocs, so
> please let me know if that's all that needs to be documented.
>
> Shai
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org