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

Custom fields in component blocks are not added to parent

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      I'm creating an Instrument repeating group and I want to add a custom field to it – this works fine so far.

      Instrument instrument = new Instrument(new Symbol("VOD.L"));
      instrument.set(new SecurityID("GB012345689"));
      instrument.set(new SecurityIDSource(SecurityIDSource.ISIN_NUMBER));
      instrument.set(new SecurityExchange("L"));
      instrument.setString(9001, "BLAH");

      However, if I add that instrument group to another fieldmap, like
      QuoteRequest.NoRelatedSym nrs = new QuoteRequest.NoRelatedSym();
      nrs.set(instrument);

      ... then the custom field won't be copied. I know that regenerating QuickFix using the extended data dictionary would solve the problem, but this should not be required.

      The problem lies in MessageComponent.java:

      public void copyFrom(FieldMap fields) {
      try {
      int[] componentFields = getFields();
      for (int i = 0; i < componentFields.length; i++) {
      if (fields.isSetField(componentFields[i]))

      { setField(componentFields[i], fields.getField(componentFields[i])); }

      }

      This shows that copyFrom (used by FieldMap.set()) only copies the fields which are present in the data dictionary.

        Attachments

          Activity

            People

            • Assignee:
              alphashock Marcin L
              Reporter:
              mvarga Mate Varga
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: