]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fix a bug which prevented some operations on variables with shadows
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 27 May 2014 12:53:52 +0000 (12:53 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 27 May 2014 12:53:52 +0000 (12:53 +0000)
fixes #4913

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29551 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java

index b86d035bd4d5e8b1ec40931f01a409aac99381ff..25d7090baf18db830f42b8ae2aa073c78deea8ac 100644 (file)
@@ -18,6 +18,7 @@ import org.simantics.sysdyn.manager.SysdynModel;
 import org.simantics.sysdyn.representation.Configuration;\r
 import org.simantics.sysdyn.representation.IElement;\r
 import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Shadow;\r
 import org.simantics.sysdyn.representation.Sheet;\r
 import org.simantics.sysdyn.representation.Variable;\r
 import org.simantics.sysdyn.ui.modelica.ModelicaSourceViewerConfiguration;\r
@@ -329,7 +330,7 @@ public abstract class NameValidator {
             return true;\r
         IElement current = sysdynModel.getElement(resource);\r
         for(IElement e : configuration.getElements()) {\r
-            if(e instanceof Variable) {\r
+            if(e instanceof Variable && !(e instanceof Shadow)) {\r
                 Variable v = (Variable) e;\r
                 if(!v.equals(current) && v.getName() != null && v.getName().equals(name)) {\r
                     return true;\r