commit | 325f3de47704417550a35eb5f0a550abb898f458 | [log] [tgz] |
---|---|---|
author | Eliza Margaretha <margaretha@ids-mannheim.de> | Tue Aug 12 15:34:59 2014 +0000 |
committer | Eliza Margaretha <margaretha@ids-mannheim.de> | Tue Aug 12 15:34:59 2014 +0000 |
tree | 838b9c317cfa056c60536cdfd8e385da2da18dfe | |
parent | 7ee76dac9f0dfad48ac77cf31ed7568157c9021b [diff] |
Fixed setting null payload
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java b/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java index 864f3a6..269fc5d 100644 --- a/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java +++ b/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java
@@ -22,7 +22,7 @@ this.doc = span.doc(); this.start = span.start(); this.end = span.end(); - this.cost = span.cost(); + this.cost = span.cost(); if (span.isPayloadAvailable()) setPayloads(span.getPayload()); @@ -73,9 +73,13 @@ return payloads; } - public void setPayloads(Collection<byte[]> payloads) { + public void setPayloads(Collection<byte[]> payloads) { + for (byte[] b : payloads){ - this.payloads.add(b.clone()); + if (b == null) + this.payloads.add(null); + else + this.payloads.add(b.clone()); } }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java index 2fe6b2b..bec7671 100644 --- a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java +++ b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
@@ -25,7 +25,6 @@ @Override public boolean next() throws IOException { - matchPayload.clear(); isStartEnumeration=false; return advance(); }