Skip to content

Commit bba7263

Browse files
author
Nathan Marz
committed
added error checking when creating combolist
1 parent 1f6237b commit bba7263

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/jvm/storm/trident/tuple/ComboList.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
public class ComboList extends AbstractList<Object> {
99
public static class Factory implements Serializable {
1010
Pointer[] index;
11+
int numLists;
1112

1213
public Factory(int... sizes) {
14+
numLists = sizes.length;
1315
int total = 0;
1416
for(int size: sizes) {
1517
total+=size;
@@ -27,6 +29,9 @@ public Factory(int... sizes) {
2729
}
2830

2931
public ComboList create(List[] delegates) {
32+
if(delegates.length!=numLists) {
33+
throw new RuntimeException("Expected " + numLists + " lists, but instead got " + delegates.length + " lists");
34+
}
3035
return new ComboList(delegates, index);
3136
}
3237
}

0 commit comments

Comments
 (0)