Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'travis/travisfw-seq-count'

  • Loading branch information...
commit 02cda16b0a8724d86956072fa08e4a723affcd88 2 parents 61cc199 + d1bc264
@nathanmarz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/jvm/backtype/storm/tuple/Tuple.java
View
6 src/jvm/backtype/storm/tuple/Tuple.java
@@ -302,6 +302,7 @@ public ISeq seq() {
Seq(List<String> fields, List<Object> values, int i) {
this.fields = fields;
this.values = values;
+ assert i >= 0;
this.i = i;
}
@@ -309,6 +310,7 @@ public Seq(IPersistentMap meta, List<String> fields, List<Object> values, int i)
super(meta);
this.fields= fields;
this.values = values;
+ assert i >= 0;
this.i = i;
}
@@ -324,7 +326,9 @@ public ISeq next() {
}
public int count() {
- return fields.size();
+ assert fields.size() -i >= 0 : "index out of bounds";
+ // i being the position in the fields of this seq, the remainder of the seq is the size
+ return fields.size() -i;
}
public Obj withMeta(IPersistentMap meta) {
Please sign in to comment.
Something went wrong with that request. Please try again.