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] Invalid toString generated for messages having names starting with a lower case letter #745

Closed
wojciech-adaptive opened this issue Jan 15, 2020 · 1 comment

Comments

@wojciech-adaptive
Copy link
Contributor

For a schema with messages having names starting with a lower case letter, e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
                   xmlns:xi="http://www.w3.org/2001/XInclude"
                   package="baseline"
                   id="1"
                   version="0"
                   semanticVersion="5.2"
                   description="Schema with lowercase message name."
                   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" description="Repeating group dimensions.">
            <type name="blockLength" primitiveType="uint16"/>
            <type name="numInGroup" primitiveType="uint16"/>
        </composite>
        <composite name="varStringEncoding" description="Variable length UTF-8 String.">
            <type name="length" primitiveType="uint32" maxValue="1073741824"/>
            <type name="varData" primitiveType="uint8" length="0" characterEncoding="UTF-8"/>
        </composite>
        <composite name="varAsciiEncoding" description="Variable length ASCII String.">
            <type name="length" primitiveType="uint32" maxValue="1073741824"/>
            <type name="varData" primitiveType="uint8" length="0" characterEncoding="ASCII"/>
        </composite>
        <composite name="varDataEncoding" description="Variable length binary blob.">
            <type name="length" primitiveType="uint32" maxValue="1073741824"/>
            <type name="varData" primitiveType="uint8" length="0"/>
        </composite>
    </types>

    <sbe:message name="foo" id="1" description="Foo type.">
        <field name="id" id="1" type="uint64"/>
    </sbe:message>
</sbe:messageSchema>

SBE 1.16.0 generates invalid toString in FooDecoder:

public String toString()
{
    fooDecoder decoder = new fooDecoder(); // doesn't compile: error: cannot find symbol
    decoder.wrap(buffer, initialOffset, BLOCK_LENGTH, SCHEMA_VERSION);

    return decoder.appendTo(new StringBuilder()).toString();
}
@mjpt777
Copy link
Contributor

mjpt777 commented Jan 15, 2020

Fixed with this commit. c55ee4d

@mjpt777 mjpt777 closed this as completed Jan 21, 2020
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