You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/03/01 09:59:36 UTC
[plc4x] branch develop updated: fix(codegen/plc4x): fixed cases where byte and short didn't work for discriminators
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new fcd6c8d fix(codegen/plc4x): fixed cases where byte and short didn't work for discriminators
fcd6c8d is described below
commit fcd6c8d59532bd237f0e8fc41099d1b363ce02b4
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Mar 1 10:59:21 2022 +0100
fix(codegen/plc4x): fixed cases where byte and short didn't work for discriminators
---
.../src/main/resources/templates/java/model-template.java.ftlh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code-generation/language-java/src/main/resources/templates/java/model-template.java.ftlh b/code-generation/language-java/src/main/resources/templates/java/model-template.java.ftlh
index 9a8f76d..edebdc3 100644
--- a/code-generation/language-java/src/main/resources/templates/java/model-template.java.ftlh
+++ b/code-generation/language-java/src/main/resources/templates/java/model-template.java.ftlh
@@ -86,7 +86,7 @@ public<#if type.isDiscriminatedParentTypeDefinition()> abstract</#if> class ${ty
<#if discriminatorType.isEnumTypeReference()>
return ${helper.getLanguageTypeNameForTypeReference(discriminatorType)}.${helper.toParseExpression(null, discriminatorType, discriminatorValue, parserArguments)};
<#else>
- return ${helper.toParseExpression(null, discriminatorType, discriminatorValue, parserArguments)};
+ return (${helper.getLanguageTypeNameForTypeReference(discriminatorType, true)}) ${helper.toParseExpression(null, discriminatorType, discriminatorValue, parserArguments)};
</#if>
<#else>
return ${helper.getNullValueForTypeReference(discriminatorType)};