Closed
Description
Hi,
With version 1.10.2
, I noticed a compilation issue in the generated decoder.
My message schema (yaml
) file is correctly parsed into xml
file. Here is my message class in generic.xml
(I omitted other non-optional fields in this class):
<message name="MyMessageClass" id="10003" description="xx" semanticType="MyMessageClass">
<other non-optional fields>
<field xmlns="" name="myMessageAttribute" id="3" type="string16" semanticType="String" description="xx" presence="optional" sinceVersion="7"/>
</message>
Here is a part of the auto generated MyMessageClassDecoder
:
public void getMyMessageAttribute(final Appendable value)
{
if (parentMessage.actingVersion < 7)
{
return "";
}
for (int i = 0; i < 16 ; ++i)
{
final int c = buffer.getByte(this.offset + 104 + i) & 0xFF;
if (c == 0)
{
break;
}
try
{
value.append(c > 127 ? '?' : (char)c);
}
catch (final java.io.IOException e)
{
throw new java.io.UncheckedIOException(e);
}
}
}
Apparently a void
method should not return string.
This issue seems only happen to fields with type string
(hence the decoder has getters
that takes Appendable
) and has the sinceVersion
attribute (hence decoder checks for actingVersion
in the getter
method).
Thanks for looking into this.
Qihao
Metadata
Metadata
Assignees
Labels
No labels