Skip to content

MessageCodeGenerator fails to set group delimiter for nested components #1084

@maxstreese

Description

@maxstreese

Describe the bug

When you run QuickFIX/J's MessageCodeGenerator on the attached Test.xml QuickFIX dictionary, the generated code does not compile because the generator does not set the group delimiter for the NestedTwiceGrp.

The generated code for NoEntries inside NestedTwice.java begins as follows:

public static class NoEntries extends Group {

  static final long serialVersionUID = 20050617;
  private static final int[] ORDER = {58, 0};

  public NoEntries() {
    super(20001, , ORDER);
  }

As you can see, the super call is malformed, because it does not specify anything for the delim parameter.

The same behavior cannot be observed when putting a field as the first item of a group (taken from Unnested.java):

public static class NoEntries extends Group {

  static final long serialVersionUID = 20050617;
  private static final int[] ORDER = {58, 0};

  public NoEntries() {
    super(20001, 58, ORDER);
  }

Nor can the same behavior be observed when putting a component which does not itself contain another component as the first item of a group (taken from NestedOnce.java):

public static class NoEntries extends Group {

  static final long serialVersionUID = 20050617;
  private static final int[] ORDER = {58, 0};

  public NoEntries() {
    super(20001, 58, ORDER);
  }

As you can see, both Unnested.java as well as NestedOnce.java set the delim parameter correctly and as expected. Only NestedTwice.java fails to do so.

To Reproduce

Run MessageCodeGenerator on the attached Test.xml. Let me know if you absolutely require a ready to run setup for this and I can provide it. I would however prefer not to spend that time at this point.

Expected behavior

NestedTwice.java should set the delim parameter correctly, just as NestedOnce.java and Unnested.java do.

system information:

  • OS: Linux
  • Java version Temurin-21.0.8+9
  • QFJ Version 2.3.2

Additional context

I am not aware of FIX TagValue placing any restrictions on nesting components inside repeating groups. Therefore if my understanding regarding this is correct, I would consider the observed behavior a bug. If such restrictions are stated by the spec it would be great if someone could point them out.

From what I understand, QuickFIX/J uses the file MessageSubclass.xsl to generate Java source code in this case and more specifically this line to generate the super call. I am not familiar with XSL and can therefore not tell if the required recursion in order to handle cases like NestedTwice.java is possible when using XSL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions