[QFJ-817] quickfix.Message parseGroup throws NumberFormatException Created: 31/Oct/14 Updated: 12/Nov/18 Resolved: 12/Nov/18 |
|
| Status: | Closed |
| Project: | QuickFIX/J |
| Component/s: | Engine |
| Affects Version/s: | 1.5.3 |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Christian Asmussen | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I fixed it with the following snippet:
private void parseGroup(String msgType, StringField field, DataDictionary dd, FieldMap parent)
throws InvalidMessage {
final DataDictionary.GroupInfo rg = dd.getGroup(msgType, field.getField());
final DataDictionary groupDataDictionary = rg.getDataDictionary();
final int[] fieldOrder = groupDataDictionary.getOrderedFields();
int previousOffset = -1;
final int groupCountTag = field.getField();
final int declaredGroupCount;
try {
declaredGroupCount = Integer.parseInt(field.getValue());
} catch(NumberFormatException nfe){
throw new FieldException(SessionRejectReason.INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, "The group " + field.getTag() + " must have an integer delimiter field [value=" + field.getValue() + "]", field.getTag());
}
This allows the parsing to continue. |
| Comments |
| Comment by Christoph John [ 31/Oct/14 ] |
|
Thanks for the suggested patch. |
| Comment by Christoph John [ 06/Feb/15 ] |
|
Just a question: why does the parsing continue when you throw a FieldException? Shouldn't the message get rejected? |
| Comment by Christoph John [ 12/Nov/18 ] |