From cd86a96617eaacfd9893bf98c09681be44072365 Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Wed, 23 Feb 2022 17:05:04 +0200 Subject: [PATCH] Allow type comparator to compare types, not just instances. gitlab #36 Change-Id: If876dffa426445e271355e92be54f6270941bfe6 --- .../src/org/simantics/interop/test/TypeComparator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java b/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java index a2a3722..6a05562 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java @@ -59,6 +59,14 @@ public class TypeComparator extends ResourceComparator { rs2.clear(); return false; } + if (rs1.size() == 0) { + rs1.addAll(g.getObjects(r1, l0.Inherits)); + rs2.addAll(g.getObjects(r2, l0.Inherits)); + } + if (rs1.size() == 0) { + rs1.addAll(g.getObjects(r1, l0.SubrelationOf)); + rs2.addAll(g.getObjects(r2, l0.SubrelationOf)); + } Comparator rcomp = getComparator().getResourceComparator(); if (rs1.size() == 0) { return rcomp.compare(r1, r2) == 0; -- 2.47.1