[QFJ-269] validate method in DataDictionary does not validate group fields Created: 10/Dec/07  Updated: 31/Aug/08  Resolved: 03/Feb/08

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.0.4, 1.2.1
Fix Version/s: 1.3.2

Type: Bug Priority: Major
Reporter: John Coleman Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

Using JVM 1.5 on WindowsXP.


Issue Links:
Duplicate
duplicates QFJ-169 Message parsing fails on messages wit... Closed

 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.



 Comments   
Comment by Toli Kuznets [ 10/Dec/07 ]

I think this is a duplicate of QFJ-169

Generated at Sat Nov 23 07:23:41 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.