From: jkauttio Date: Tue, 27 May 2014 12:53:52 +0000 (+0000) Subject: Fix a bug which prevented some operations on variables with shadows X-Git-Tag: 1.8.1~44 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=9ad45d41f8ffc180c6c7dc70aa7bec661de34cb5;p=simantics%2Fsysdyn.git Fix a bug which prevented some operations on variables with shadows fixes #4913 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29551 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java index b86d035b..25d7090b 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java @@ -18,6 +18,7 @@ import org.simantics.sysdyn.manager.SysdynModel; import org.simantics.sysdyn.representation.Configuration; import org.simantics.sysdyn.representation.IElement; import org.simantics.sysdyn.representation.Module; +import org.simantics.sysdyn.representation.Shadow; import org.simantics.sysdyn.representation.Sheet; import org.simantics.sysdyn.representation.Variable; import org.simantics.sysdyn.ui.modelica.ModelicaSourceViewerConfiguration; @@ -329,7 +330,7 @@ public abstract class NameValidator { return true; IElement current = sysdynModel.getElement(resource); for(IElement e : configuration.getElements()) { - if(e instanceof Variable) { + if(e instanceof Variable && !(e instanceof Shadow)) { Variable v = (Variable) e; if(!v.equals(current) && v.getName() != null && v.getName().equals(name)) { return true;