Details
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++)
}
}
[NB: Some of the validate method calls do not work with above suggestion.]
A generic tree walking technique would be handy in many places.
Attachments
Issue Links
- duplicates
-
QFJ-169 Message parsing fails on messages with invalid fields in repeating groups with non-obvious errors
- Closed