You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rj...@apache.org on 2016/03/20 21:50:56 UTC
lucene-solr:branch_6_0: LUCENE-7118: Move numDims check before modulo
numDims
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6_0 d92561e6e -> a600e6f2d
LUCENE-7118: Move numDims check before modulo numDims
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a600e6f2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a600e6f2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a600e6f2
Branch: refs/heads/branch_6_0
Commit: a600e6f2dd121104ddf0f28cb0120544703e9455
Parents: d92561e
Author: Ryan Ernst <rj...@apache.org>
Authored: Sun Mar 20 13:49:33 2016 -0700
Committer: Ryan Ernst <rj...@apache.org>
Committed: Sun Mar 20 13:50:48 2016 -0700
----------------------------------------------------------------------
.../src/java/org/apache/lucene/search/PointRangeQuery.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a600e6f2/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
index d798c22..cfa644f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
@@ -62,6 +62,9 @@ public abstract class PointRangeQuery extends Query {
protected PointRangeQuery(String field, byte[] lowerPoint, byte[] upperPoint, int numDims) {
checkArgs(field, lowerPoint, upperPoint);
this.field = field;
+ if (numDims <= 0) {
+ throw new IllegalArgumentException("numDims must be positive, got " + numDims);
+ }
if (lowerPoint.length == 0) {
throw new IllegalArgumentException("lowerPoint has length of zero");
}
@@ -71,9 +74,6 @@ public abstract class PointRangeQuery extends Query {
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;