From 966b434fad24b63ed4147f00b1775ac4e5ceb58b Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 19 May 2020 13:41:44 -0500 Subject: [PATCH] fix nesting error in combinations logic --- .../virtdata/core/bindings/VirtDataComposer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/bindings/VirtDataComposer.java b/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/bindings/VirtDataComposer.java index 6375ef850..76ad8f45b 100644 --- a/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/bindings/VirtDataComposer.java +++ b/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/bindings/VirtDataComposer.java @@ -215,12 +215,15 @@ public class VirtDataComposer { } Object[][] combinations = new Object[modulo][]; + for (int row = 0; row < combinations.length; row++) { Object[] combination = new Object[allargs.length]; int number = row; for (int pos = 0; pos < combination.length; pos++) { - int selector = (int) (row / modulos[pos]); - combination[pos] = allargs[pos][selector]; + int selector = (int) (number / modulos[pos]); + Object[] allargspos = allargs[pos]; + Object objectatpos = allargspos[selector]; + combination[pos] = objectatpos; number %= modulos[pos]; } combinations[row] = combination;