[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 ]

Fixed by https://github.com/quickfix-j/quickfixj/pull/150

Generated at Sat Nov 23 09:20:42 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.