[ https://issues.apache.org/jira/browse/LUCENE-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467953 ]
Doron Cohen commented on LUCENE-781: ------------------------------------ One could write an application that groups readers to multiReaders in more than 1 level, i.e. r1,r2,r3 grouped to rr1, r4,r5,r6 grouped to rr2, rr1,rr2 grouped to rrr. If rrr.isCurrent() throws unsupported, the application needs to question recursively. I am not aware of such an application, so you could argue this is only theoretic, still it demonstrates a strength of Lucene. Also, here too, as argued above, even if the answer is false (not current), the application would need to apply the same recursive logic to reopen the non-current reader and reconstruct the multi-reader. So I agree it is valid to throw unsupported. Just that it feels a bit uncomfortable to throw unsupported for existing API of a method with well defined meaning that is quite easy to implement (relying on that anyhow it was never implemented correctly). > 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]