I checked - the fix is working and code seems right.

While we are looking at this, there are a few more IndexReader methods
which are not implemented by MultiReader.

These 3 methods seems ok:
- document(int)
  would work because IndexReader would send to document(int,FieldSelector)
  which is implemented in MultiReader.
- termDocs(Term),
- termPositions(Term)
  would both work because IndexReader implementations goes to termDocs() or
  to termPositions(), which both are implemented in MultiReader.

These 3 methods should probably be fixed:
- isOptimized()
  would fail - similar to isCurrent()
- setNorm(int, String, float)
  would fail too, similar reason.
- directory()
  would not fail, but fall to return the directory of reader[0],
  is this a correct behavior?
  this is because MultiReader() (constructor) calls super with reader[0] -
  again, I am not sure, is this correct? (why allowing to create
  a multi-reader with no readers at all?)

BTW: I tried to add this as a JIRA comment, but it failed
several times with some servlet exception.

"Daniel Naber (JIRA)" <[EMAIL PROTECTED]> wrote on 22/01/2007 13:39:30:

>
>      [ https://issues.apache.org/jira/browse/LUCENE-781?page=com.
> atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Daniel Naber updated LUCENE-781:
> --------------------------------
>
>     Attachment: multireader.diff
>
> > NPe in MultiReader.isCurrent() and getVersion()
> > -----------------------------------------------
> >
> >                 Key: LUCENE-781
> >                 URL: https://issues.apache.org/jira/browse/LUCENE-781
> >             Project: Lucene - Java
> >          Issue Type: Bug
> >          Components: Index
> >            Reporter: Daniel Naber
> >         Attachments: multireader.diff, multireader_test.diff
> >
> >
> > I'm attaching a fix for the NPE in MultiReader.isCurrent() plus a
> testcase. For getVersion(), we should throw a better exception that
> NPE. I will commit unless someone objects or has a better idea.
>


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

Reply via email to