From ae4e50137568b142b705370ac2dc335f5ea8d854 Mon Sep 17 00:00:00 2001 From: lempinen Date: Fri, 18 Jan 2013 08:19:09 +0000 Subject: [PATCH] Reference to self no longer creates a "not connected" issue (fixes #3999) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26643 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/sysdyn/ui/validation/DependencyFunction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java index 95106f03..78fa3130 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java @@ -19,6 +19,7 @@ import java.util.Set; import org.simantics.db.Issue; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; +import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; import org.simantics.layer0.Layer0; @@ -172,6 +173,11 @@ public class DependencyFunction { if(variablesReferences == null || variablesReferences.isEmpty()) return result; + // Remove references to self + String name = NameUtils.getSafeName(graph, component); + if(name != null && variablesReferences.contains(name)) + variablesReferences.remove(name); + // Find all variables that are linked to component with arrows Set dependencies = ValidationUtils.getDependencies(graph, component); dependencies.addAll(GLOBAL_VARIABLES); -- 2.47.1