From: Tuukka Lehtonen Date: Tue, 30 Oct 2018 11:01:34 +0000 (+0200) Subject: Fixed invalid comparisons which were identified by Eclipse IDE 2018-09 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=d4ae453f1f2e85de5650d75c03180fe776d1c914;p=simantics%2Fplatform.git Fixed invalid comparisons which were identified by Eclipse IDE 2018-09 gitlab #171 Change-Id: I357469f6cbef6c099e59d3a378ef531c0eca8e5f --- diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/request/Queries.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/request/Queries.java index a7e2ba740..91b5346a3 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/request/Queries.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/request/Queries.java @@ -207,7 +207,7 @@ class IsInstanceOfQuery2 implements Read { return false; else if (getClass() != object.getClass()) return false; - IsInstanceOfQuery other = (IsInstanceOfQuery) object; + IsInstanceOfQuery2 other = (IsInstanceOfQuery2) object; return resource.equals(other.resource) && type.equals(other.type); } diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java index 56e1e11f2..8ac919984 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java @@ -1157,7 +1157,8 @@ public class Layer0Utils { Resource indexRoot = graph.syncRequest(new PossibleVariableIndexRoot(variable)); if(indexRoot == null) return false; - if(variable.equals(indexRoot)) return false; + Resource represents = variable.getPossibleRepresents(graph); + if(represents != null && represents.equals(indexRoot)) return false; return isPublished(graph, indexRoot); } diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionMonitorSupportImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionMonitorSupportImpl.java index a178f99b3..356460e4b 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionMonitorSupportImpl.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionMonitorSupportImpl.java @@ -50,7 +50,7 @@ public class SessionMonitorSupportImpl implements SessionMonitorSupport { return; int i = 0; for (i = 0; i < session.monitorHandlers.length; i++) { - if (h.equals(session.monitorHandlers)) + if (h.equals(session.monitorHandlers[i])) break; } if (i < session.monitorHandlers.length) { diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/TerminalUtil.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/TerminalUtil.java index da9829428..462569451 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/TerminalUtil.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/TerminalUtil.java @@ -414,7 +414,7 @@ public class TerminalUtil { public static boolean isSameTerminal(TerminalInfo t1, TerminalInfo t2) { if (t1 == null || t2 == null) return false; - return t1.e.equals(t2.e) && t1.t.equals(t2.e); + return t1.e.equals(t2.e) && t1.t.equals(t2.t); } /** diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectAccessor.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectAccessor.java index c056096aa..295e60e2f 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectAccessor.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectAccessor.java @@ -84,7 +84,7 @@ public class RelatedObjectAccessor implements IDomainAccessor