mirror of https://github.com/apache/lucene.git
LUCENE-7442: MinHashFilter's ctor should validate its args
This commit is contained in:
parent
f177a660f5
commit
36362a2a69
|
@ -53,6 +53,9 @@ Bug Fixes
|
||||||
ArrayIndexOutOfBoundsException exception on large index segments (>1.8B docs)
|
ArrayIndexOutOfBoundsException exception on large index segments (>1.8B docs)
|
||||||
with large skips. (yonik)
|
with large skips. (yonik)
|
||||||
|
|
||||||
|
* LUCENE-7442: MinHashFilter's ctor should validate its args.
|
||||||
|
(Cao Manh Dat via Steve Rowe)
|
||||||
|
|
||||||
Improvements
|
Improvements
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
|
|
|
@ -114,6 +114,15 @@ public class MinHashFilter extends TokenFilter {
|
||||||
*/
|
*/
|
||||||
public MinHashFilter(TokenStream input, int hashCount, int bucketCount, int hashSetSize, boolean withRotation) {
|
public MinHashFilter(TokenStream input, int hashCount, int bucketCount, int hashSetSize, boolean withRotation) {
|
||||||
super(input);
|
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.hashCount = hashCount;
|
||||||
this.bucketCount = bucketCount;
|
this.bucketCount = bucketCount;
|
||||||
this.hashSetSize = hashSetSize;
|
this.hashSetSize = hashSetSize;
|
||||||
|
|
Loading…
Reference in New Issue