- edited description
Union predicate appears to have indexes range issue in evaluate
Issue #3
open
The implementation of evaluate() in UnionPredicate (included below for reference) appears to have an issue when iterating over the indexes array. The counting loop goes from 0 to indexes.length. I believe it should go from 0 to current.
public List<Value> evaluate(List<Value> values, List<Value> results) {
for(Value value: values) {
int currentValueSize = value.size();
for(int j=0;j<Array.getLength(indexes);j++) {
if(indexes[j] >= 0 && indexes[j] < currentValueSize) {
results.add(value.get(indexes[j]));
} else if(indexes[j] < 0 && (currentValueSize - indexes[j]) >= 0) {
results.add(value.get(currentValueSize + indexes[j]));
}
}
}
return results;
}
Comments (3)
-
reporter -
repo owner - changed status to open
- edited description
If I re-use this union predicate I will make sure to fix this.
-
repo owner -
assigned issue to
-
assigned issue to
- Log in to comment