showWarning(result2.second);
comparator2.test(getSession());
changes2 = comparator2.getChanges();
- changes2 = getSession().syncRequest(new FilterChangesRead(changes2, filters));
+ changes2 = getSession().syncRequest(createFilterRead(changes2, filters));
updateTree2 = getUpdateTree(changes2);
updateList2 = getUpdateList(changes2);
showWarning(result3.second);
comparator3.test(getSession());
changes3 = comparator3.getChanges();
- changes3 = getSession().syncRequest(new FilterChangesRead(changes3, filters));
+ changes3 = getSession().syncRequest(createFilterRead(changes3, filters));
}
Pair<GraphComparator,String> result = getChanges(oldModel,newModel);
}
comparator.test(getSession());
changes = comparator.getChanges();
- changes = getSession().syncRequest(new FilterChangesRead(changes, filters));
+ changes = getSession().syncRequest(createFilterRead(changes, filters));
updateTree = getUpdateTree(changes);
updateList = getUpdateList(changes);
if (userFilters.size() != 0) {
// Create filtered changes
List<ChangeFilter> combined = new ArrayList<>(filters);
combined.addAll(userFilters);
- GraphChanges filteredChanges = getSession().syncRequest(new FilterChangesRead(changes, combined));
+ GraphChanges filteredChanges = getSession().syncRequest(createFilterRead(changes, combined));
UpdateTree updateTreeF = getUpdateTree(filteredChanges);
UpdateList updateListF = getUpdateList(filteredChanges);
// hide changes that are not contained within the filtered changes.
for (PropertyChange rc : r) {
if (comparable.containsRight(rc))
continue;
- if (lc.getFirst().equals(rc.getFirst())) {
+ if (lc.getFirst() != null && lc.getFirst().equals(rc.getFirst())) {
+ comparable.map(lc, rc);
+ break;
+ }
+ if (lc.getSecond() != null && lc.getSecond().equals(rc.getSecond())) {
comparable.map(lc, rc);
break;
}
return Simantics.getSession();
}
+ public Read<GraphChanges> createFilterRead(GraphChanges changes, List<ChangeFilter> filters) {
+ return new FilterChangesRead(changes, filters);
+ }
+
public static class FilterChangesRead implements Read<GraphChanges> {
if (pair.getFirst() != null) {
boolean found = false;
for (PropertyChange pair2 : updateList2.getChanges()) {
- if (pair.getFirst().equals(pair2.getSecond())) {
+ if (pair.getFirst() != null && pair.getFirst().equals(pair2.getSecond())) {
found = true;
break;
}