LUCENE-7118: Fix packed points upper/lower bound length check

This commit is contained in:
Ryan Ernst 2016-03-20 13:34:22 -07:00
parent e1a1dbfabc
commit 54e662b6da
1 changed files with 4 additions and 1 deletions

View File

@ -68,9 +68,12 @@ public abstract class PointRangeQuery extends Query {
if (lowerPoint.length % numDims != 0) {
throw new IllegalArgumentException("lowerPoint is not a fixed multiple of numDims");
}
if (upperPoint.length != upperPoint.length) {
if (lowerPoint.length != upperPoint.length) {
throw new IllegalArgumentException("lowerPoint has length=" + numDims + " but upperPoint has different length=" + upperPoint.length);
}
if (numDims <= 0) {
throw new IllegalArgumentException("numDims must be positive, got " + numDims);
}
this.numDims = numDims;
this.bytesPerDim = lowerPoint.length / numDims;