]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Reference to self no longer creates a "not connected" issue (fixes #3999)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 18 Jan 2013 08:19:09 +0000 (08:19 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 18 Jan 2013 08:19:09 +0000 (08:19 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26643 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java

index 95106f037d7a71afbf91c45edfd786785ddbbfcf..78fa31308bfc8b7b207fdb85050034a8a8ef6428 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Set;
 import org.simantics.db.Issue;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.layer0.Layer0;\r
@@ -172,6 +173,11 @@ public class DependencyFunction {
         if(variablesReferences == null || variablesReferences.isEmpty())\r
             return result;\r
         \r
+        // Remove references to self\r
+        String name = NameUtils.getSafeName(graph, component);\r
+        if(name != null && variablesReferences.contains(name))\r
+            variablesReferences.remove(name);\r
+        \r
         // Find all variables that are linked to component with arrows\r
         Set<String> dependencies = ValidationUtils.getDependencies(graph, component);\r
         dependencies.addAll(GLOBAL_VARIABLES);\r