You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/09/12 14:31:32 UTC
[3/4] lucene-solr:branch_6_2: LUCENE-7442: MinHashFilter's ctor
should validate its args
LUCENE-7442: MinHashFilter's ctor should validate its args
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/109ec234
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/109ec234
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/109ec234
Branch: refs/heads/branch_6_2
Commit: 109ec23426d6d42c7cefd10ad96a56ca504e6a9a
Parents: c7b3e9a
Author: Steve Rowe <sa...@apache.org>
Authored: Mon Sep 12 10:18:29 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Sep 12 10:30:00 2016 -0400
----------------------------------------------------------------------
.../org/apache/lucene/analysis/minhash/MinHashFilter.java | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/109ec234/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java
index 772f58a..4ddf711 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java
@@ -114,6 +114,15 @@ public class MinHashFilter extends TokenFilter {
*/
public MinHashFilter(TokenStream input, int hashCount, int bucketCount, int hashSetSize, boolean withRotation) {
super(input);
+ if (hashCount <= 0) {
+ throw new IllegalArgumentException("hashCount must be greater than zero");
+ }
+ if (bucketCount <= 0) {
+ throw new IllegalArgumentException("bucketCount must be greater than zero");
+ }
+ if (hashSetSize <= 0) {
+ throw new IllegalArgumentException("hashSetSize must be greater than zero");
+ }
this.hashCount = hashCount;
this.bucketCount = bucketCount;
this.hashSetSize = hashSetSize;