diff options
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org')
5 files changed, 12 insertions, 12 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend index 3c0dfbcf5..7f6b2fa87 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend @@ -42,7 +42,7 @@ class ConfigGenAddon { // For SubSystemClassGen - def public genActorInstanceConfig(ActorInstance ai, String aiVariableName){''' + def genActorInstanceConfig(ActorInstance ai, String aiVariableName){''' «FOR a : ai.actorClass.allAttributes» «applyInstanceConfig(ai, aiVariableName, new ArrayList<Attribute>().union(a))» «ENDFOR» @@ -73,7 +73,7 @@ class ConfigGenAddon { } DataClass: ''' - «FOR e : (aType as DataClass).allAttributes» + «FOR e : aType.allAttributes» «applyInstanceConfig(instance, invokes+"."+a.name.invokeGetter(null), path.union(e))» «ENDFOR» ''' @@ -82,7 +82,7 @@ class ConfigGenAddon { // For ActorClassGen - def public genDynConfigGetterSetter(ActorClass ac){''' + def genDynConfigGetterSetter(ActorClass ac){''' «FOR a : dataConfigExt.getDynConfigReadAttributes(ac)» public «a.type.type.typeName»«IF a.size>0»[]«ENDIF» get«a.name.toFirstUpper»(){ if(lock_«a.name» == null) @@ -112,7 +112,7 @@ class ConfigGenAddon { «ENDFOR» '''} - def public genMinMaxConstants(ActorClass ac){ + def genMinMaxConstants(ActorClass ac){ var result = ''' «FOR a : ac.allAttributes» «genMinMaxConstantsRec(ac, a.name, new ArrayList<Attribute>().union(a))» @@ -128,7 +128,7 @@ class ConfigGenAddon { switch aType { DataClass: ''' - «FOR e : (aType as DataClass).allAttributes» + «FOR e : aType.allAttributes» «genMinMaxConstantsRec(ac, varNamePath+"_"+e.name, path.union(e))» «ENDFOR» ''' diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend index 539fe8728..98abc87d5 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend @@ -81,7 +81,7 @@ class Initialization { switch (aType) { DataClass: return ''' - «FOR e : (aType as DataClass).allAttributes» + «FOR e : aType.allAttributes» «attributeInitPrimitiveRec(path.union(e), roomClass)» «ENDFOR» ''' diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend index 5f2a5e64b..6848cc105 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend @@ -37,9 +37,9 @@ import org.eclipse.etrice.core.room.PrimitiveType import org.eclipse.etrice.core.room.RoomClass import org.eclipse.etrice.generator.generic.ILanguageExtension import org.eclipse.etrice.generator.generic.TypeHelpers -import org.eclipse.xtext.util.Pair import org.eclipse.etrice.generator.java.Main import org.eclipse.etrice.generator.java.setup.GeneratorOptionsHelper +import org.eclipse.xtext.util.Pair @Singleton class JavaExtensions implements ILanguageExtension { @@ -49,7 +49,7 @@ class JavaExtensions implements ILanguageExtension { override String getTypedDataDefinition(EObject msg) { if (msg instanceof Message) { - generateArglistAndTypedData((msg as Message).data).get(TypedDataKind.DECLARATION_AND_INITIALIZATION.ordinal) + generateArglistAndTypedData(msg.data).get(TypedDataKind.DECLARATION_AND_INITIALIZATION.ordinal) } else { "" @@ -215,9 +215,9 @@ class JavaExtensions implements ILanguageExtension { EnumerationType: dt.defaultValue ExternalType: - "new "+(dt as ExternalType).targetName+"()" + "new "+ dt.targetName+"()" default: - "new "+dt.name+"()" + "new "+ dt.name+"()" } } diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/MainGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/MainGen.xtend index f6c41eaee..a8f7f0399 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/MainGen.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/MainGen.xtend @@ -42,7 +42,7 @@ class MainGen { prepFS.prepare for (e: resource.contents){ if (e instanceof Root) { - doGenerate(e as Root) + doGenerate(e) } } } diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend index 7ac34c3d5..eefc984d1 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend @@ -90,7 +90,7 @@ class NodeGen { */ def private HashSet<ActorClass> getOptionalActorClasses(Root root, StructureInstance si) { val aifs = Lists::newArrayList(si.eAllContents.filter(i|i instanceof ActorInterfaceInstance).map[aii|aii as ActorInterfaceInstance]) - val result = Sets::newHashSet(aifs.map[aii|(aii as ActorInterfaceInstance).actorClass]) + val result = Sets::newHashSet(aifs.map[aii|aii.actorClass]) for (ai : aifs) { for (oi : ai.optionalInstances) { result.addAll(root.getOptionalActorClasses(oi)) |