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

toString() Method Breaks Repeating Groups

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not a bug
    • Affects Version/s: 1.6.0
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
    • Environment:
      OS X 10.11.2
      jdk1.8.0_65

      Description

      Given a valid FIX 4.4 Execution Report FIX string containing a repeating group passed as the single argument to the constructor of the Message type, immediately calling the toString() method on the new instance results in the repeating group being mangled.

      Below is the output of the sample program which demonstrates the bug. The first message has field 382[NoContraBrokers] in the correct place at the start of ContraGrp. The toString result has field 375[ContraBroker] coming before 382 which is incorrectly placed outside the group.

      Fix String before creating Message instance:
      8=FIX.4.4|9=173|35=8|34=3|49=BRKR|52=20121105-23:24:42|56=BANZAI|6=0|11=1352157882577|14=0|17=1|20=0|31=0|32=0|37=1|38=10000|39=0|54=1|55=MSFT|150=2|151=0|382=1|375=1|655=2|437=444|438=888|10=111|

      Fix String after calling toString() on the new instance of Message:
      8=FIX.4.4|9=173|35=8|34=3|49=BRKR|52=20121105-23:24:42|56=BANZAI|6=0|11=1352157882577|14=0|17=1|20=0|31=0|32=0|37=1|38=10000|39=0|54=1|55=MSFT|150=2|151=0|375=1|382=1|437=444|438=888|655=2|10=111|

      ----------------------- Sample Code -------------------------

      package com.globalforge.infix;

      import quickfix.InvalidMessage;
      import quickfix.Message;

      public class QuickFixGroupTest {
      static String FIX_44_EXEC_REPORT =
      "8=FIX.4.49=17335=834=349=BRKR52=20121105-23:24:4256=BANZAI6=011=135215788257714=017=120=031=032=037=138=1000039=054=155=MSFT150=2151=0382=1375=1655=2437=444438=88810=111";

      public static String rs(String ins)

      { return ins.replaceAll("\u0001", "|"); }

      public static void main(String[] args) {
      System.out.println("before: " + rs(FIX_44_EXEC_REPORT));
      try

      { Message quickFixMsg = new Message(FIX_44_EXEC_REPORT); System.out.println("after : " + rs(quickFixMsg.toString())); }

      catch (InvalidMessage e)

      { e.printStackTrace(); }

      }
      }

        Attachments

          Activity

            People

            • Assignee:
              chrjohn Christoph John
              Reporter:
              mstarkie Mike Starkie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: