Skip to content

Commit

Permalink
Fixed nullpointer bug in rare circumstances with empty VCs (#33)
Browse files Browse the repository at this point in the history
Change-Id: Id43e6e427ed258be03494b1e82b0d504ac5a8cc9
  • Loading branch information
Akron committed Sep 5, 2017
1 parent 0d6a981 commit 291baad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
0.55.8 2017-07-04
0.55.8 2017-09-05
- [feature] Retrieve and display pagebreaks (diewald)
- [bugfix] Handle invalid dates in input (diewald)
- [feature] Support availability meta data (diewald)
- [bugfix] Do not respond with a "match all" VC if the
VC data (e.g. JSON) is wrong (diewald)
- [cleanup] Improved test suite for queries/VC with wildcards
and regexes (margaretha, diewald)
- [bugfix] Ignore zero-bit bitset segments in searching (diewald)

0.55.7 2017-01-24
- [bugfix] Sorted results in unordered element distance query
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/de/ids_mannheim/korap/KrillIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,12 @@ public Result search (Krill ks) {
* Todo: There may be a way to know early if the bitset is emty
* by using LongBitSet - but this may not be as fast as I think.
*/
final Bits bitset = collection.bits(atomic);
final FixedBitSet bitset = collection.bits(atomic);

if (bitset.nextSetBit(0) == DocIdSetIterator.NO_MORE_DOCS) {
continue;
};

final PositionsToOffset pto = new PositionsToOffset(atomic,
field);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ public void testWithKrillWithCollection () throws IOException {
.getResource("/queries/bugs/cosmas_wildcards_qao.jsonld")
.getFile());
krill = new Krill(json);
assertEquals(krill.getCollection().toString(),
"QueryWrapperFilter(availability:/QAO.*/)");
kr = krill.apply(sample);
assertEquals(4, kr.getMatches().size());
}
Expand Down

0 comments on commit 291baad

Please sign in to comment.