Skip to content

Commit

Permalink
[Java] Allow for block length and numInGroup to be of type UINT32 Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Mar 25, 2020
1 parent 8164855 commit f491d59
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ private void generateGroupDecoderClassHeader(
indent,
dimensionHeaderLen);

final String blockLenCast = PrimitiveType.UINT32 == blockLengthType ? "(int)" : "";
final String numInGroupCast = PrimitiveType.UINT32 == numInGroupType ? "(int)" : "";

sb.append("\n")
.append(indent).append(" public void wrap(final ").append(readOnlyBuffer).append(" buffer)\n")
.append(indent).append(" {\n")
Expand All @@ -377,8 +380,8 @@ private void generateGroupDecoderClassHeader(
.append(indent).append(" index = 0;\n")
.append(indent).append(" final int limit = parentMessage.limit();\n")
.append(indent).append(" parentMessage.limit(limit + HEADER_SIZE);\n")
.append(indent).append(" blockLength = ").append(blockLengthGet).append(";\n")
.append(indent).append(" count = ").append(numInGroupGet).append(";\n")
.append(indent).append(" blockLength = ").append(blockLenCast).append(blockLengthGet).append(";\n")
.append(indent).append(" count = ").append(numInGroupCast).append(numInGroupGet).append(";\n")
.append(indent).append(" }\n");

sb.append("\n")
Expand Down

0 comments on commit f491d59

Please sign in to comment.