Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend13
1 files changed, 10 insertions, 3 deletions
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 923fa4a3b..5f2a5e64b 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
@@ -38,11 +38,14 @@ 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
@Singleton
class JavaExtensions implements ILanguageExtension {
@Inject TypeHelpers typeHelpers
+ @Inject protected extension GeneratorOptionsHelper
override String getTypedDataDefinition(EObject msg) {
if (msg instanceof Message) {
@@ -261,9 +264,13 @@ class JavaExtensions implements ILanguageExtension {
castTypeName = (data.refType.type as EnumerationType).castType
}
- val dataArg = ", " + GENERIC_DATA_NAME
- val typedData = typeName + " " + GENERIC_DATA_NAME + " = ("+castTypeName+") generic_data__et;\n"
- val typedArgList = ", " + typeName + " " + GENERIC_DATA_NAME
+ val dataName = if (Main.settings.isOldStyleTransitionData && data.deprecatedName!==null && !data.deprecatedName.trim.empty)
+ data.deprecatedName
+ else
+ GENERIC_DATA_NAME
+ val dataArg = ", " + dataName
+ val typedData = typeName + " " + dataName + " = ("+castTypeName+") generic_data__et;\n"
+ val typedArgList = ", " + typeName + " " + dataName
return newArrayList(dataArg, typedData, typedArgList)
}

Back to the top