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

validate method in DataDictionary does not validate group fields

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4, 1.2.1
    • Fix Version/s: 1.3.2
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Using JVM 1.5 on WindowsXP.

      Description

      It is possible for QFJ to accept messages with invalid field values as defined in the data dictionary xml file enumerations. This can result in code built on QFJ crashing due to acceptance of messages with invalid fields, and thus developer must enforce validation using hard-coding to avoid this.

      The DataDictionary.validate method only checks values on the top level of the message and does not walk the group field trees.

      It is necessary to add code at the end of the method similar to following:

      Map groups = map.getGroups();
      if (groups.size() > 0) {
      Iterator groupIter = groups.entrySet().iterator();
      while (groupIter.hasNext()) {
      Map.Entry entry = (Map.Entry) groupIter.next();
      List groupInstances = ((List) entry.getValue());
      for (int i = 0; i < groupInstances.size(); i++)

      { FieldMap groupFields = (FieldMap) groupInstances.get(i); iterate(groupFields, msgType); }

      }
      }

      [NB: Some of the validate method calls do not work with above suggestion.]

      A generic tree walking technique would be handy in many places.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                johncoleman John Coleman
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: