[FAST-47] byteVector having default value causes StringIndexOutOfBoundsException Created: 17/May/13  Updated: 23/Jan/14  Resolved: 20/May/13

Status: Resolved
Project: OpenFAST
Component/s: Types
Affects Version/s: 1.1.2
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Dmitry Vulf Assignee: Jacob Northey
Resolution: Not a bug Votes: 0
Labels: byteVector
Environment:

Win x64, JDK 1.7


Attachments: XML File FIX50SP2-ALL.xml    

 Description   

having this line in the template file:
<byteVector name="SecurityIDSource" id="22" presence="optional"><default value="4"/></byteVector>
get exception in ByteUtil.convertHexStringToByteArray
in line
bytes[i / 2] = (byte) Integer.parseInt(hexString.substring(i, i + 2), 16);



 Comments   
Comment by Jacob Northey [ 17/May/13 ]

The byteVector default value uses the hex format so that any byte value can be represented. Can you try to use hex encoding for the default value? If you are using ASCII encoding then the default value should be 34. Try the following:

<byteVector name="SecurityIDSource" id="22" presence="optional"><default value="34"/></byteVector> 
Comment by Dmitry Vulf [ 20/May/13 ]

Thanks,
Changing values manually fixes the issue. However MICEX(Moscow stock exchange) provides default values for byteVector not in the hex format (I attached the template) and it happens in several places.
Compatibility error or MICEX applies wrong format?

Comment by Jacob Northey [ 20/May/13 ]

Hi Dmitry,

I've posted a new message on the FAST Protocol forums here: http://fixprotocol.org/discuss/read/ff6dc431. Hopefully this issue can be resolved by the Market Data Optimization Working Group.

Regards,
Jake

Comment by Jacob Northey [ 20/May/13 ]

It looks like MICEX is not following the spec for how to encode default values for byteVector fields. Is there somebody at the exchange you can inform to update their templates? Since OpenFAST is following the FAST specification I will mark this as not an issue.

http://fixprotocol.org/discuss/read/8bac4745

If MICEX is unable to resolve the issue it might make sense to write a script that will parse the FAST templates and convert from the ASCII-encoded default value to the hex-encoded format.

Comment by Jacob Northey [ 20/May/13 ]

OpenFAST is following the FAST specification in terms of how to define byteVector default values.

Comment by Dmitry Vulf [ 20/May/13 ]

Hi Jake,
Thanks for the investigation.
I'll inform MICEX about this issue.

Comment by Andrey Alekov [ 23/Jan/14 ]

Dmitry,
MICEX and RTS (now both are is MOEX) don't follow full FAST 1.1 specification.

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