Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug on ZIP function when handling a list with only singletons #18

Merged
merged 2 commits into from
Mar 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions warp10/src/main/java/io/warp10/continuum/gts/ZIP.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Object apply(WarpScriptStack stack) throws WarpScriptException {
// Check the size of the various lists, they are either singletons or of the same size
//

int len = -1;
int len = 1;

for (Object o: metalist) {
if (!(o instanceof List)) {
Expand All @@ -66,7 +66,7 @@ public Object apply(WarpScriptStack stack) throws WarpScriptException {
continue;
}

if (-1 == len) {
if (1 == len) {
len = size;
} else if (size != len) {
throw new WarpScriptException(getName() + " operates on lists of lists. All lists which are not singletons must be of the same size.");
Expand Down