You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (Updated) (JIRA)" <ji...@apache.org> on 2011/12/07 16:56:40 UTC
[jira] [Updated] (LUCENE-3624) Throw exception for
"Multi-SortedSource" instead of returning null
[ https://issues.apache.org/jira/browse/LUCENE-3624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-3624:
--------------------------------
Attachment: LUCENE-3624.patch
Here's a patch. I did the same for getArray() <-- don't call this if hasArray() returns false or you get UOE, consistent with ByteBuffer.
Now if you try to merge a SlowMultiReaderWrapper, the error is more obvious:
{noformat}
[junit] java.lang.UnsupportedOperationException: asSortedSource is not supported
[junit] at org.apache.lucene.index.values.IndexDocValues$Source.asSortedSource(IndexDocValues.java:224)
[junit] at org.apache.lucene.index.values.SortedBytesMergeUtils.buildSlices(SortedBytesMergeUtils.java:89)
[junit] at org.apache.lucene.index.values.VarSortedBytesImpl$Writer.merge(VarSortedBytesImpl.java:68)
[junit] at org.apache.lucene.index.codecs.PerDocConsumer.merge(PerDocConsumer.java:84)
[junit] at org.apache.lucene.index.SegmentMerger.mergePerDoc(SegmentMerger.java:321)
[junit] at org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:124)
[junit] at org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:2429)
{noformat}
> Throw exception for "Multi-SortedSource" instead of returning null
> ------------------------------------------------------------------
>
> Key: LUCENE-3624
> URL: https://issues.apache.org/jira/browse/LUCENE-3624
> Project: Lucene - Java
> Issue Type: Task
> Reporter: Robert Muir
> Attachments: LUCENE-3624.patch
>
>
> Spinoff of LUCENE-3623: currently if you addIndexes(FIR) or similar, you get a NPE deep within codecs during merge.
> I think the NPE is confusing, it looks like a bug but a clearer exception would be an improvement.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org