[QFJ-763] Wrong constant values in NoSides Created: 11/Dec/13  Updated: 02/Apr/15  Resolved: 12/Dec/13

Status: Closed
Project: QuickFIX/J
Component/s: Message Generation
Affects Version/s: 1.5.3
Fix Version/s: 1.6.0

Type: Bug Priority: Default
Reporter: Isaac Levin Assignee: Christoph John
Resolution: Fixed Votes: 0
Labels: None


 Description   

NoSides extends IntField, but constants for ONE_SIDE and BOTH_SIDES are defined as char.

public class NoSides extends IntField {
static final long serialVersionUID = 20050617;
public static final int FIELD = 552;
public static final char ONE_SIDE = '1';
public static final char BOTH_SIDES = '2';
...

When you call:
message.set(new NoSides(NoSides.ONE_SIDE));
Then the wrong value 49 (Ascii code of '1') instead of 1 is sent.



 Comments   
Comment by Christoph John [ 12/Dec/13 ]

Wow, this really is a special case. NoSides seems to be the only repeating group delimiter field which has constants specified. However, I would rather not do "message.set(new NoSides(NoSides.ONE_SIDE));" on my own but rather add the repeating group to the message which then does the necessary calculation for the NoSides field.

Comment by Christoph John [ 12/Dec/13 ]

Committed as rev1126: http://sourceforge.net/p/quickfixj/code/1126/

Generated at Sat Nov 23 00:02:16 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.