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 44244f1
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class CodecConfiguration
public static final String PARENT_PACKAGE_PROPERTY = "fix.codecs.parent_package";
public static final String FLYWEIGHTS_ENABLED_PROPERTY = "fix.codecs.flyweight";
public static final String REJECT_UNKNOWN_ENUM_VALUE_PROPERTY = "reject.unknown.enum.value";
public static final String FLOAT_OVERFLOW_HANDLER_PROPERTY = "float.overflow.handler";
public static final String FLOAT_OVERFLOW_HANDLER_PROPERTY = "fix.codecs.float_overflow_handler";
public static final String FIX_TAGS_IN_JAVADOC = "fix.codecs.tags_in_javadoc";

public static final String DEFAULT_PARENT_PACKAGE = "uk.co.real_logic.artio";
Expand Down
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 44244f1

Please sign in to comment.