Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-216

Support recursive custom group definitions in the code generator

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Default
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: Future Releases
    • Component/s: Message Generation
    • Labels:
      None
    • Environment:
      windows XP/java 1.5_06

      Description

      Suppose I have the following xml message definition

      <message name="FirmPrice" msgtype="UN020" msgcat="app">
      <field name="Symbol" required="Y"/>
      <field name="Size" required="Y"/>
      <group name="NoPriceEntries" required="Y">
      <component name="PriceComponent" required="Y"/>
      </group>
      <group name="NoLegEntries" required="N">
      <component name="LegComponent" required="N"/>
      </group>
      </message>

      ...

      <component name="LegComponent">
      <field name="Size" required="Y"/>
      <field name="Symbol" required="Y"/>
      <group name="NoPriceEntries" required="Y">
      <component name="PriceComponent" required="Y"/>
      </group>
      </component>

      The message generation creates a MessageFactory.java which has the following snippet of code in it:

      if("UN020".equals(msgType)) {
      switch(correspondingFieldID)

      { case liquidity.quickfix.fields.NoPriceEntries.FIELD: return new liquidity.quickfix.messages.FirmPrice.NoPriceEntries(); case liquidity.quickfix.fields.NoLegEntries.FIELD: return new liquidity.quickfix.messages.FirmPrice.NoLegEntries(); case liquidity.quickfix.fields.NoPriceEntries.FIELD: return new liquidity.quickfix.messages.FirmPrice.NoLegEntries.NoPriceEntries(); }

      }

      This cannot compile, obviously, as it has a duplicate case label. So, it seems like the usage of a field in both, the enclosing message and the nested component is not handled properly by the generated code.

      Looks like this is due to "NoPriceEntries" appearing twice: once in the main body of the message, and once in the subcomponent "LegComponent".

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              swinger Lev Grevnin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: