Skip to content

Commit

Permalink
HY-92 : bug when using float overflow handler with dictionary where a…
Browse files Browse the repository at this point in the history
… message has repeating groups
  • Loading branch information
lucianoviana committed Feb 4, 2025
1 parent ad692e0 commit c6d7a60
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ else if (type == HEADER)
}

out.append(classDeclaration(className, interfaces, false, aggregate.isInParent(), isGroup));
if (decimalFloatOverflowHandler != null && type != HEADER)
if (decimalFloatOverflowHandler != null && type != HEADER && type != GROUP)
{
out.append(String.format(" public %s() {\n\n", className));
out.append(String.format(" decimalFloatOverflowHandler = new %s",
Expand Down Expand Up @@ -999,13 +999,23 @@ private void wrapTrailerAndMessageFieldsInGroupConstructor(final Writer out, fin
out.append(String.format(
" private final TrailerDecoder trailer;\n" +
" private final IntHashSet %1$s;\n" +
" public %2$s(final TrailerDecoder trailer, final IntHashSet %1$s)\n" +
" {\n" +
" this.trailer = trailer;\n" +
" this.%1$s = %1$s;\n" +
" }\n\n",
" public %2$s(final TrailerDecoder trailer, final IntHashSet %1$s)\n",
MESSAGE_FIELDS,
decoderClassName(aggregate)));

out.append(String.format(
" {\n" +
" this.trailer = trailer;\n" +
" this.%1$s = %1$s;\n",
MESSAGE_FIELDS));

if (decimalFloatOverflowHandler != null)
{
out.append(String.format(" decimalFloatOverflowHandler = new %s",
decimalFloatOverflowHandler + "();\n\n"));
}

out.append(" }\n\n");
}

private void wrapTrailerInConstructor(final Writer out, final Aggregate aggregate) throws IOException
Expand Down
Loading

0 comments on commit c6d7a60

Please sign in to comment.