]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Fixed invalid comparisons which were identified by Eclipse IDE 2018-09"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 30 Oct 2018 11:55:18 +0000 (11:55 +0000)
committerGerrit Code Review <gerrit2@simantics>
Tue, 30 Oct 2018 11:55:18 +0000 (11:55 +0000)
bundles/org.simantics.db.common/src/org/simantics/db/common/request/Queries.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionMonitorSupportImpl.java
bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/TerminalUtil.java
bundles/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectAccessor.java

index a7e2ba740ea4ba1a435ca631c5a3a9642765329f..91b5346a3072e51ed5e09e4daa1daa53d7a38613 100644 (file)
@@ -207,7 +207,7 @@ class IsInstanceOfQuery2 implements Read<Boolean> {
             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);
     }
 
index 438c629b67432b6b6b4ac1cc90b8db75c5a15630..ee97fdb5827a723d8f1e86520d0343a81dbaee7f 100644 (file)
@@ -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);
 
     }
index a178f99b3c999974b8b60c953b509b06650bf6d0..356460e4bb6444b3caf77b19cff981947a23f99d 100644 (file)
@@ -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) {
index da98294284aba29e314ee056168004c91d92189b..462569451ac6363baed8a969b3ad48bc76cb2709 100644 (file)
@@ -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);
     }
 
     /**
index c056096aab67d9743ef93ad927de07b16da8d296..295e60e2f29796eb96ea7ce88a90c2610018efd0 100644 (file)
@@ -84,7 +84,7 @@ public class RelatedObjectAccessor implements IDomainAccessor<StructuralResource
                            g.claim(element, relation, value.getResource());
                            return true;
                        }
-                       else if(resource.equals(value))
+                       else if(resource.equals(value.getResource()))
                            return false;
                        else {
                                if (preventChange(selement))