From fc925ded1e95aa606467be0e6fe32d7c635c38c4 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 5 Feb 2013 23:33:46 +0000 Subject: [PATCH] move assert up to ctor git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1442798 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/src/java/org/apache/lucene/index/MultiDocValues.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java index 7345fe725e0..6416dcc5eef 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java @@ -278,6 +278,8 @@ public class MultiDocValues { final OrdinalMap mapping; MultiSortedDocValues(SortedDocValues values[], int docStarts[], OrdinalMap mapping) throws IOException { + assert values.length == mapping.ordDeltas.length; + assert docStarts.length == values.length + 1; this.values = values; this.docStarts = docStarts; this.mapping = mapping; @@ -294,7 +296,6 @@ public class MultiDocValues { public void lookupOrd(int ord, BytesRef result) { int subIndex = (int) mapping.subIndexes.get(ord); int segmentOrd = (int) (ord - mapping.globalOrdDeltas.get(ord)); - assert subIndex < values.length; values[subIndex].lookupOrd(segmentOrd, result); }