[ https://issues.apache.org/jira/browse/LUCENE-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467655 ]
Hoss Man commented on LUCENE-781: --------------------------------- so the fundamental issue is two radically different use cases of MultiReader -- and these methods really only have meaning when talking about a single directory. if getVersion, isCurrent and isOptimized, have *never* worked with a MultiReader constructed using "new MultiReader(IndexReader[])" then throwing UnsupportedOperationException definitely seems like the best course of action ... the semantics of those methods don't really make sense on a multi-directory index. for setNorm we should be able to loop over the sub readers and call setNorm on each right? the 50 thousand dollar question is should directory() be modified to throw UnsupportedOperationException even though it doesn't currently throw an NPE ? ... i think it should. I think the MultiReader(IndexReader[]) constructor should allways call super(null) -- anyone currently relying on MultiReader.directory() it to return the directory of the "first" IndexReader should be able to easily change their code. if we want to make it really easy we could provide a MultiReader.getSubReader(int n) method. > 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]