Skip to content

Commit cb1fb37

Browse files
committed
fix: support maxSize > 1000 in map mutator
The `@WithSize(max = maxSize)` annotation with `maxSize > 1000` was silently being ignored by the `MapMutator`. Closes #977
1 parent d88ad22 commit cb1fb37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/code_intelligence/jazzer/mutation/mutator/collection/MapMutatorFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ private static final class MapMutator<K, V> extends SerializingInPlaceMutator<Ma
9696
int maxSize) {
9797
this.keyMutator = keyMutator;
9898
this.valueMutator = valueMutator;
99-
this.minSize = Math.max(minSize, DEFAULT_MIN_SIZE);
100-
this.maxSize = Math.min(maxSize, DEFAULT_MAX_SIZE);
101-
99+
this.minSize = minSize;
100+
this.maxSize = maxSize;
102101
require(maxSize >= 1, format("WithSize#max=%d needs to be greater than 0", maxSize));
103102
// TODO: Add support for min > 0 to map. If min > 0, then #read can fail to construct
104103
// sufficiently many distinct keys, but the mutation framework currently doesn't offer

0 commit comments

Comments
 (0)