[ https://issues.apache.org/jira/browse/LUCENE-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466930 ]
Doron Cohen commented on LUCENE-781: ------------------------------------ > ...either way, i'd still like clarification as to the orriginal point of this > issue ... what was the bug? what would trigger the NPE? It is triggers by having two ways to construct a MultiReader: (1) as IndexReader does it for the regular (multi segment) index MultiReader(Directory directory, SegmentInfos sis, boolean closeDirectory, IndexReader[] subReaders) (2) as anyone can use it, for aggregating results from any indexes: MultiReader(IndexReader[] subReaders) In (1) all readers use the same directory, and there is a single SegnentInfos. This is the standard, tested way. In (2) there is no single dir and no single SegmentInfos. This is the "general", less tested way. In this option, dir (of the multiReader) is initialized to that of subReader[0]. This seems spooky to me. Also in this option, SegmentInfos in null. It makes sense, since readers can be anything - but this is the cause for the NPE. BTW, after (being surprised by) your first comment on this, I checked in 1.9.1 - the test (of case (2)) fails there as well. > 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. -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]