Skip to content

Commit

Permalink
fixed bug in Extensible Store
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Dec 28, 2024
1 parent b66f5e9 commit 557a5f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@ class ReadCommittedWrapper implements DataStructureInterface {

@Override
public void addStatement(ExtensibleStatement statement) {
internalAdded.put(statement, statement);
internalRemoved.remove(statement);

ExtensibleStatement put = internalAdded.put(statement, statement);
if (put == null) {
internalRemoved.remove(statement);
}
}

@Override
public void removeStatement(ExtensibleStatement statement) {
internalRemoved.put(statement, statement);
ExtensibleStatement put = internalRemoved.put(statement, statement);
if (put == null) {
internalAdded.remove(statement);
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ public void testUpdateQuery2() {
"INSERT {" + statement + "}" +
"WHERE {?a ?b ?c}").execute();

assertEquals(1, added.size());
assertEquals(1, removed.size());
assertEquals(added, removed, "Added (expected) is not the same as removed (actual)");

assertEquals(2, addedRaw.size());
assertEquals(2, removedRaw.size());

assertEquals(added, removed);
assertEquals(1, added.size());
assertEquals(1, removed.size());

}

Expand Down

0 comments on commit 557a5f6

Please sign in to comment.