Skip to content

Add setRaw() method for Set type encoder (#1086) - #1122

Merged
vyazelenko merged 2 commits into
aeron-io:masterfrom
aymenjam:master
Sep 9, 2026
Merged

Add setRaw() method for Set type encoder (#1086)#1122
vyazelenko merged 2 commits into
aeron-io:masterfrom
aymenjam:master

Conversation

@aymenjam

@aymenjam aymenjam commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

getRaw() is generated in the decoder for Set (bitset) types, but the
symmetric setRaw() method is missing from the generated encoder,
preventing direct writes of a raw bitset value without going through
individual choice setters.

Fixes #1086

Solution

Added generation of setRaw() in JavaGenerator#generateBitSet, mirroring
the existing getRaw() decoder logic, using the same generatePut
mechanism already used elsewhere in the generator.

Testing

Added shouldGenerateBitSetRawAccessor in JavaGeneratorTest, which
encodes a raw value via setRaw() and verifies it round-trips correctly
through the existing getRaw() decoder method.

All existing tests pass, including shouldGenerateBitSetCodecs.

@vyazelenko vyazelenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Just minor things with a test.

@aymenjam

aymenjam commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@vyazelenko
Simplified as suggested — thanks for the review!

@vyazelenko
vyazelenko merged commit fc96ed3 into aeron-io:master Sep 9, 2026
34 checks passed
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

Successfully merging this pull request may close these issues.

[Java] Add setRaw() method for Set type

2 participants