[ https://issues.apache.org/jira/browse/LUCENE-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466636 ]
Doron Cohen commented on LUCENE-781: ------------------------------------ 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?) > 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]