Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java code generation has issue with mixed case and composite types #582

Closed
damageboy opened this issue Sep 2, 2018 · 0 comments
Closed

Comments

@damageboy
Copy link
Contributor

When I use this schema with the Java code generation in sbe-tool:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
                   package="Bug"
                   id="8787"
                   version="0"
                   semanticVersion="0.1"
                   description="Bug"
                   byteOrder="littleEndian">
    <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>
            <composite name="groupSizeEncoding" semanticType="NumInGroup">
            <type name="blockLength" primitiveType="uint16"/>
            <type name="numInGroup" primitiveType="uint16"/>
        </composite>
        <composite name="OrderBase">
          <type name="Account" primitiveType="char" length="12"/>
        </composite>
        <composite name="Order">
          <ref name="OrderBase" type="OrderBase"/>
          <type name="AccountNotMessedUp2" primitiveType="char" length="12"/>
        </composite>
    </types>
    <sbe:message name="NewOrderRequest" id="1" description="submit a new order on an instrument">
        <field name="Order" id="2" type="Order"/>
    </sbe:message>
</sbe:messageSchema>

I get non-compiling java files.

The issue seems to be that when the code-generator generates the code for the Account field inside the OrderBase composite type it generates a function called AccountLength() while attempting to invoke it as accountLength()

On the other hand, when the same is attempted with AccountNotMessedUp2 field in the composite type Order the generated code appears to be fine.

So if I understand this correctly, when there's a generation of a Decoder/Encode for a second level composite type, the SBE java code generator will mix up the casing of the generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants