Skip to content
Snippets Groups Projects
Commit 1122c746 authored by Jürgen Walter's avatar Jürgen Walter
Browse files

name fixes

parent 899a6334
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ public abstract class ModelBuilder implements IModelBuilder{
public EObject addAllocationContext(String componentName, String hostName) {
EObject allocation;
componentName = applyNameFixes(componentName);
if(!allocationMap.containsKey(componentName+seperatorChar+hostName)){
allocation = createAllocation(componentName, hostName);
allocationMap.put(componentName+seperatorChar+hostName, allocation);
......@@ -94,7 +94,7 @@ public abstract class ModelBuilder implements IModelBuilder{
}
public void addInterface(String interfaceName){
interfaceName = applyComponentNameFix(interfaceName);
interfaceName = applyNameFixes(interfaceName);
if(!interfaceMap.containsKey(interfaceName)){
EObject newInterface = createInterface(interfaceName);
interfaceMap.put(interfaceName, newInterface);
......@@ -103,6 +103,8 @@ public abstract class ModelBuilder implements IModelBuilder{
public EObject addAssembly(String name) {
EObject assembly;
name = applyNameFixes(name);
if(!assemblyMap.containsKey(name)){
assembly = createAssembly(name);
assemblyMap.put(name, assembly);
......@@ -113,7 +115,7 @@ public abstract class ModelBuilder implements IModelBuilder{
}
public EObject getAssembly(String assemblyName){
//assemblyName = applyComponentNameFix(assemblyName);
assemblyName = applyNameFixes(assemblyName);
EObject assembly = assemblyMap.get(assemblyName);
if (assembly == null) {
log.error("Could not find AssemblyContext: " + assemblyName);
......@@ -155,7 +157,7 @@ public abstract class ModelBuilder implements IModelBuilder{
}
public EObject getComponent(String componentName){
componentName = applyComponentNameFix(componentName);
componentName = applyNameFixes(componentName);
EObject component = componentMap.get(componentName);
if(component == null){
log.error("requested component ["+componentName+"] has not been created");
......@@ -164,7 +166,7 @@ public abstract class ModelBuilder implements IModelBuilder{
return component;
}
public static String applyComponentNameFix(String componentName){
public static String applyNameFixes(String componentName){
if(componentName.contains("$")){
//log.info("FIX:" + componentName + " ==> "+componentName.split("\\$")[0]);
componentName = componentName.split("\\$")[0]; //JAVA $
......@@ -173,7 +175,7 @@ public abstract class ModelBuilder implements IModelBuilder{
}
public void addComponent(String componentName) {
componentName = applyComponentNameFix(componentName);
componentName = applyNameFixes(componentName);
if(!hasComponentBeenAdded(componentName)){
componentMap.put(componentName, createComponent(componentName));
}
......@@ -210,8 +212,8 @@ public abstract class ModelBuilder implements IModelBuilder{
}
public void addMethod(ComponentType type, Signature signature){
if(!methodMap.containsKey(Util.createMethodKey(signature.getName(), applyComponentNameFix(type.getTypeName())))){
methodMap.put(Util.createMethodKey(signature.getName(), applyComponentNameFix(type.getTypeName())), createMethod(type, signature));
if(!methodMap.containsKey(Util.createMethodKey(signature.getName(), applyNameFixes(type.getTypeName())))){
methodMap.put(Util.createMethodKey(signature.getName(), applyNameFixes(type.getTypeName())), createMethod(type, signature));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment