Commit 07f4a991 authored by Nils Kaminski's avatar Nils Kaminski
Browse files

Fix getTargetLanguageVariableInstanceName for e.g.: comp[2].port[1]

parent 26a99f71
......@@ -33,12 +33,14 @@ public class GeneralHelperMethods {
* @return
*/
public static String getTargetLanguageVariableInstanceName(String name) {
String nameChanged = "";
int indexSecond = 0;
while (true) {
int indexFirst = name.indexOf("[", indexSecond);
if (indexFirst != -1) {
nameChanged += name.substring(0, indexFirst);
nameChanged += name.substring(indexSecond, indexFirst);
indexSecond = name.indexOf("]", indexFirst + 1);
if (indexSecond != -1) {
String subString = name.substring(indexFirst + 1, indexSecond++);
......@@ -57,5 +59,6 @@ public class GeneralHelperMethods {
if (nameChanged.equals(""))
return name;
return nameChanged;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment