[QFJ-413] The repeating group count check doesn't work if the count == 0 Created: 12/Mar/09  Updated: 15/Nov/12  Resolved: 23/May/11

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.4.0
Fix Version/s: 1.5.1

Type: Bug Priority: Default
Reporter: Francis Uy Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None


 Description   

1) repro steps:
===========
send any message with valid repeating group fields except in the count, set the value to zero.

2) bad behavior:
============
No error is thrown. the repeating group is not ignored and is parsed anyway even though the group count is zero. Note: i don't think fix protocol states how to handle this case but i would assume this is an error.

3) expected behavior:
================
normally, if the count value doesn't match the actual number of "repeating group" you get this error: "Incorrect NumInGroup count for repeating group"



 Comments   
Comment by Francis Uy [ 12/Mar/09 ]

forgot to put the code that ignores zero in FieldMap.java ...

protected void setGroupCount(int countTag, int groupSize) {
if (groupSize == 0)

{ return; }

...
...
}

Comment by Francis Uy [ 12/Mar/09 ]

this is called in Message.java->parseGroup() ... at the bottom you have ...

// For later validation that the group size matches the parsed group count
parent.setGroupCount(groupCountTag, declaredGroupCount);

Comment by Francis Uy [ 27/Mar/09 ]

possible fix is to put this as a check above the previous comment.

if (declaredGroupCount == 0 && parent.getGroupCount(groupCountTag) != 0)

{ throw new FieldException( SessionRejectReason.VALUE_IS_INCORRECT, field.getTag()); }
Comment by Steve Bate [ 06/Apr/10 ]

Just to clarify... this is an issue if the group count is zero and yet the groups are actually there.

Comment by Steve Bate [ 23/May/11 ]

SVN #1036.

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