X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FModelUpdate.java;h=5f400df4c653285946551ea0f2addf8c4c81f497;hb=refs%2Fheads%2Frelease%2F1.39.0;hp=d76c47bdf655998c902de59f6f2b7f08c58f7bd8;hpb=237d8b627738ed212599f77aea944bec20fd3497;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java index d76c47b..5f400df 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java @@ -18,6 +18,7 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.util.Layer0Utils; import org.simantics.db.request.Read; import org.simantics.interop.test.GraphChanges; +import org.simantics.interop.test.GraphChanges.Modification; import org.simantics.interop.test.GraphComparator; import org.simantics.utils.datastructures.BijectionMap; import org.simantics.utils.datastructures.Pair; @@ -376,9 +377,9 @@ public abstract class ModelUpdate { protected GraphChanges filterChanges(ReadGraph g, GraphChanges changes) throws DatabaseException { - List> modifications = new ArrayList>(); + List modifications = new ArrayList(); - for (Pair mod : changes.getModifications()) { + for (Modification mod : changes.getModifications()) { boolean accept = true; for (ChangeFilter filter : filters) { @@ -397,7 +398,7 @@ public abstract class ModelUpdate { public interface ChangeFilter { - public boolean accept(ReadGraph g, Pair change) throws DatabaseException; + public boolean accept(ReadGraph g, Modification change) throws DatabaseException; } @@ -421,12 +422,12 @@ public abstract class ModelUpdate { } @Override - public boolean accept(ReadGraph g, Pair change) throws DatabaseException { + public boolean accept(ReadGraph g, Modification change) throws DatabaseException { //filter floating point values that have less than 1% difference. - if (!g.hasValue(change.first.getObject()) || !g.hasValue(change.second.getObject())) + if (!g.hasValue(change.getLeftStm().getObject()) || !g.hasValue(change.getRightStm().getObject())) return true; - Object v1 = g.getValue(change.first.getObject()); - Object v2 = g.getValue(change.second.getObject()); + Object v1 = g.getValue(change.getLeftStm().getObject()); + Object v2 = g.getValue(change.getRightStm().getObject()); if (v1 instanceof Double && v2 instanceof Double) { double d1 = (Double)v1;