CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 11:30:12 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=285.353606,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=726.47019,issue_conversation_sidebar-fragment;desc="issue_conversation_sidebar fragment";dur=58.289812,nginx;desc="NGINX";dur=1.347203,glb;desc="GLB";dur=97.806216
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=O6XAMwD%2FLMqRVk2gzXZ3l4nabv9b7C0cC%2F6MpeYccoGdwhH6SreaxW8lRQx2%2BgcTE2ZBg8hgFcFnjnsZY5GdWOAI7R1pVwl6MBhrJP7A7Hljm9Ngj0wH4IlbovdwjKrxe54WgV3HBNkasfFyzvgtxVjPomZkYtLNFBil9yPv7j3UJqK5W2DEhNuPikuuxqBrxacOANfn%2FcFmT4iIKuEg47xMBEjizm8kciKh%2FfQcFPzSLDFPqqvLjLmxsn0NUVDDv4Svc3Rr6wjm3J09KAU%2FYg%3D%3D--qQsdx7tQiFDq0xxM--Enl%2FmjBvf%2Fs2qSfEB5lmEA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1181376086.1752924611; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 11:30:11 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 11:30:11 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: BF60:249704:424513:534C5E:687B81C3
Generates invalid CSharp code when using sinceVersion attribute inside groups · Issue #543 · aeron-io/simple-binary-encoding · GitHub
No one assignedNo labelsNo typeNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 542
Closed
Description
Thanks for this great library! :-)
I think this is an issue for @billsegall, as it relates to the CSharp code generation.
We're generating code using the sbe-tool:1.7.6
JAR.
When we have the following structure in the schema file
- message
- group (sinceVersion = 42)
- field (sinceVersion = 42)
- group (sinceVersion = 42)
the C# code that is generated does not compile.
This code fragment is representative of the problem:
public SimpleCompositeV0 Value
{
get
{
if (actingVersion < 42) return null;
_value.Wrap(_buffer, _offset + 0, _actingVersion);
return _value;
}
}
If actingVersion
were prefixed with an underscore I believe it would fix the issue.
It looks like it may come from this line: https://github.com/real-logic/simple-binary-encoding/blob/4b64c6f4a678f6ccb5604c5f5e0b2cade3e5bfa2/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java#L700
Full schema
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:messageSchema xmlns:ns2="https://fixprotocol.io/2016/sbe" package="N.B., package is required but not used" id="32353" version="42" 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="varStringEncoding" description="Variable length string encoding">
<type name="length" maxValue="2147483647" primitiveType="uint32"/>
<type name="varData" length="0" primitiveType="uint8" characterEncoding="UTF-8"/>
</composite>
<composite name="varDataEncoding" description="Variable length data encoding">
<type name="length" maxValue="2147483647" primitiveType="uint32"/>
<type name="varData" length="0" primitiveType="uint8"/>
</composite>
<composite name="groupSizeEncoding" description="Group size encoding">
<type name="blockLength" primitiveType="uint16"/>
<type name="numInGroup" primitiveType="uint16"/>
</composite>
</types>
<types>
<composite name="simpleCompositeV0">
<type name="foo" primitiveType="int32"/>
</composite>
</types>
<ns2:message name="brokenMessageV0" id="5746">
<group dimensionType="groupSizeEncoding" name="brokenGroup" id="1" sinceVersion="42">
<field name="value" id="2" type="simpleCompositeV0" sinceVersion="42"/>
</group>
</ns2:message>
</ns2:messageSchema>
Generated class
public sealed partial class BrokenMessageV0
{
public const ushort BlockLength = (ushort)0;
public const ushort TemplateId = (ushort)5746;
public const ushort SchemaId = (ushort)32353;
public const ushort SchemaVersion = (ushort)42;
public const string SemanticType = "";
private readonly BrokenMessageV0 _parentMessage;
private DirectBuffer _buffer;
private int _offset;
private int _limit;
private int _actingBlockLength;
private int _actingVersion;
public int Offset { get { return _offset; } }
public BrokenMessageV0()
{
_parentMessage = this;
}
public void WrapForEncode(DirectBuffer buffer, int offset)
{
_buffer = buffer;
_offset = offset;
_actingBlockLength = BlockLength;
_actingVersion = SchemaVersion;
Limit = offset + _actingBlockLength;
}
public void WrapForDecode(DirectBuffer buffer, int offset, int actingBlockLength, int actingVersion)
{
_buffer = buffer;
_offset = offset;
_actingBlockLength = actingBlockLength;
_actingVersion = actingVersion;
Limit = offset + _actingBlockLength;
}
public int Size
{
get
{
return _limit - _offset;
}
}
public int Limit
{
get
{
return _limit;
}
set
{
_buffer.CheckLimit(value);
_limit = value;
}
}
private readonly BrokenGroupGroup _brokenGroup = new BrokenGroupGroup();
public const long BrokenGroupId = 1;
public const int BrokenGroupSinceVersion = 42;
public const int BrokenGroupDeprecated = 0;
public bool BrokenGroupInActingVersion()
{
return _actingVersion >= BrokenGroupSinceVersion;
}
public BrokenGroupGroup BrokenGroup
{
get
{
_brokenGroup.WrapForDecode(_parentMessage, _buffer, _actingVersion);
return _brokenGroup;
}
}
public BrokenGroupGroup BrokenGroupCount(int count)
{
_brokenGroup.WrapForEncode(_parentMessage, _buffer, count);
return _brokenGroup;
}
public sealed partial class BrokenGroupGroup
{
private readonly GroupSizeEncoding _dimensions = new GroupSizeEncoding();
private BrokenMessageV0 _parentMessage;
private DirectBuffer _buffer;
private int _blockLength;
private int _actingVersion;
private int _count;
private int _index;
private int _offset;
public void WrapForDecode(BrokenMessageV0 parentMessage, DirectBuffer buffer, int actingVersion)
{
_parentMessage = parentMessage;
_buffer = buffer;
_dimensions.Wrap(buffer, parentMessage.Limit, actingVersion);
_blockLength = _dimensions.BlockLength;
_count = _dimensions.NumInGroup;
_actingVersion = actingVersion;
_index = -1;
_parentMessage.Limit = parentMessage.Limit + SbeHeaderSize;
}
public void WrapForEncode(BrokenMessageV0 parentMessage, DirectBuffer buffer, int count)
{
_parentMessage = parentMessage;
_buffer = buffer;
_dimensions.Wrap(buffer, parentMessage.Limit, _actingVersion);
_dimensions.BlockLength = (ushort)4;
_dimensions.NumInGroup = (ushort)count;
_index = -1;
_count = count;
_blockLength = 4;
parentMessage.Limit = parentMessage.Limit + SbeHeaderSize;
}
public const int SbeBlockLength = 4;
public const int SbeHeaderSize = 4;
public int ActingBlockLength { get { return _blockLength; } }
public int Count { get { return _count; } }
public bool HasNext { get { return (_index + 1) < _count; } }
public BrokenGroupGroup Next()
{
if (_index + 1 >= _count)
{
throw new InvalidOperationException();
}
_offset = _parentMessage.Limit;
_parentMessage.Limit = _offset + _blockLength;
++_index;
return this;
}
public System.Collections.IEnumerator GetEnumerator()
{
while (this.HasNext)
{
yield return this.Next();
}
}
public const int ValueId = 2;
public const int ValueSinceVersion = 42;
public const int ValueDeprecated = 0;
public bool ValueInActingVersion()
{
return _actingVersion >= ValueSinceVersion;
}
public static string ValueMetaAttribute(MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
case MetaAttribute.Epoch: return "unix";
case MetaAttribute.TimeUnit: return "nanosecond";
case MetaAttribute.SemanticType: return "";
case MetaAttribute.Presence: return "required";
}
return "";
}
private readonly SimpleCompositeV0 _value = new SimpleCompositeV0();
public SimpleCompositeV0 Value
{
get
{
if (actingVersion < 42) return null;
_value.Wrap(_buffer, _offset + 0, _actingVersion);
return _value;
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Issue actions
You can’t perform that action at this time.