From: miettinen Date: Fri, 21 Mar 2014 10:41:58 +0000 (+0000) Subject: Bugfix to Sysdyn unit parsing for functions (refs #4779). X-Git-Tag: 1.8.1~109 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=fe12b76e2fb5baf475a92c84bcd894fa155febb3;p=simantics%2Fsysdyn.git Bugfix to Sysdyn unit parsing for functions (refs #4779). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29184 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/Function.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/Function.java index bedd3247..ddec7b65 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/Function.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/Function.java @@ -91,7 +91,7 @@ public class Function implements Comparable{ while ((index = ret.indexOf('\'')) >= 0) { String replaced = ret.substring(index, index + 2); // The replaced units are always of length 2. try { - ret = ret.replace(replaced, correspondences.get(replaced)); + ret = ret.replace(replaced, "(" + correspondences.get(replaced) + ")"); } catch (NullPointerException npe) { throw new UnitCheckingException("Function " + f.getName() + " output unit could not be determined. Replacement unit " + replaced + " not found in input unit definitions.");