[Java] - TokenCodecEncoder/Decoder do not encode packageName attribute of Token (original) (raw)

Version:
1.35.6

Description:
The TokenCodecEncoder class:
https://github.com/aeron-io/simple-binary-encoding/blob/master/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java

does not encode field packageName in:
https://github.com/aeron-io/simple-binary-encoding/blob/master/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Token.java#L82

As a result, this information is lost in the sbeir file generated by SbeTool (prop = sbe.generate.ir)

Impact:

  1. IR does not roundtrip when encoded and then decoded
  2. Package info for types is lost in the encoded ir (.sbeir)

To Recreate:
schema.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  package="factory.acme.models"
  id="1"
  version="1"
  byteOrder="littleEndian">
  
  <types package="factory.acme.types">
  
    <composite name="messageHeader" description="Message identifiers and length of message root">
      <type name="blockLength" primitiveType="uint16"/>
      <type name="templateId" primitiveType="uint16"/>
      <type name="schemaId" primitiveType="uint16"/>
      <type name="version" primitiveType="uint16"/>
    </composite>
  
    <enum name="MyEnum" encodingType="uint8">
      <validValue name="UNKNOWN">0</validValue>
      <validValue name="ONE">1</validValue>
      <validValue name="TWO">2</validValue>
    </enum>
    
  </types>

  <sbe:message name="MyMessage" id="999">
    <field name="myEnum" id="1" type="MyEnum" />
  </sbe:message>

</sbe:messageSchema>

Image

Image