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;
}
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;
}
public PropertyChange(GraphChanges changes, Statement first, Statement second) {
+ if (first == null && second == null)
+ throw new IllegalArgumentException("At least one of the stamenents must be non null.");
this.pair = new Pair<Statement, Statement>(first, second);
this.changes = changes;
}
public PropertyChange(GraphChanges changes, Pair<Statement, Statement> change) {
+ if (change == null || (change.first == null && change.second == null))
+ throw new IllegalArgumentException("At least one of the stamenents must be non null.");
this.pair = change;
this.changes = changes;
}
this.visible = visible;
}
+ @Override
+ public String toString() {
+ String s = "PropertyChange";
+ if (pair.first != null)
+ s += " (" + (pair.first.getSubject()) + " , " + pair.first.getPredicate() + " , " + pair.first.getObject() + ")";
+ if (pair.second != null)
+ s += " (" + (pair.second.getSubject()) + " , " + pair.second.getPredicate() + " , " + pair.second.getObject() + ")";
+ return s;
+ }
+
}