squah-confluent commented on code in PR #18127:
URL: https://github.com/apache/kafka/pull/18127#discussion_r1881393382
##########
generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java:
##########
@@ -1343,6 +1343,11 @@ private void generateVariableLengthFieldSize(FieldSpec
field,
buffer.printf("int _sizeBeforeStruct =
_size.totalSize();%n", field.camelCaseName());
buffer.printf("this.%s.addSize(_size, _cache,
_version);%n", field.camelCaseName());
buffer.printf("int _structSize = _size.totalSize() -
_sizeBeforeStruct;%n", field.camelCaseName());
+
VersionConditional.forVersions(field.nullableVersions(), possibleVersions).
+ ifMember(__ -> {
+ buffer.printf("_structSize += 1;%n");
+ }).
+ generate(buffer);
Review Comment:
I think I understand what you mean. The `+ 1` is due to the block at L1336
so we should move it into the size calculation below and clone it for the
non-tagged case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]