|
From: dumitriu <dm...@co...> - 2008-08-21 17:21:14
|
Yup, I've run into this CRAZY issue as well. :) toli wrote: > > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > Hey, > > I have a question about no-arg constructors of DateField subclasses, > such as SendingTime and TransactTime. > > It seems that if you use no-arg constructors for these fields, you > always get a field with some constant arbitrary time in it. For > example: > > Message msg = new Message(); > msg.setField(new TransactTime()); > sleep(20 seconds) > msg.setField(new SendingTime()); > > You get the same exact time in both TransactTime and SendingTime > fields. This is b/c the no-arg constructors are implemented to get the > time from a static Calendar that's part of the DateField superclass, > and the Calendar class is implemented to have a static 'current time' > value that's initialized once and kept. > > Is there any particular reason why the no-arg constructor for > DateField subclasses has this behaviour? I'd expect that it'd be the > equivalent of new SendingTime(new Date()), ie it'd always create a > field with the latest time. > > i'm not sure if this is a bug or a C++ QF compatibility issue, but i > can't think of a use case where you'd want this behaviour. It's not > even returning the time the FIX engine started - it's just some > arbitrary time when the very first DateField was created. > > thoughts? > > -- > Toli Kuznets > http://www.marketcetera.com: Open-Source Trading Platform > download.run.trade. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfixj-users > > -- View this message in context: http://n2.nabble.com/No-arg-constructor-for-DateFields-tp364975p740736.html Sent from the QuickFIX/J mailing list archive at Nabble.com. |