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

Subclasses of quickfix.field.UtcTimeStampField don't preserve milliseconds during creation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.0.5
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None

      Description

      the UtcTimeStampField has a boolean argument whether or not t preserve the millisecond field from a timestamp.

      However, none of the subclasses call that constructor, as a result, the milliseconds are always lost when you round-trip something like
      Date aDate = new Date();
      assertEquals("rountdrip fails", aDate.getTime(), (new EffectiveTime(aDate)).getValue().getTime());

      Message msg = new Message();
      msg.setField(new EffectiveTime(aDate));
      assertEquals("rountdrip from msg fails", aDate.getTime(), msg.getField(new EffectiveTime()).getValue().getTime());

      Fails in the second assert with: rountdrip from msg fails expected:<1172696741599> but was:<1172696741000>

      So the milliseconds are lost when a subclass of UtcTimeStampField is retrieved from the message.

      The 2nd part is that FieldMap doesn't later use the UtcTimeStampField.showMilliseconds() when it stores the fields in the message.
      So the values are lost even at sending (marshaling) time, not just at unmarshaling.

      Interestingly, there seems to be a similar error in Quickfix as well: http://www.quickfixengine.org/bugtracker/bug.php?op=show&bugid=1&pos=0

        Attachments

          Activity

            People

            • Assignee:
              toli Toli Kuznets
              Reporter:
              toli Toli Kuznets
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: