[FAST-45] NPE when parsing empty mantissa and exponent elements Created: 14/May/12  Updated: 14/May/12  Resolved: 14/May/12

Status: Resolved
Project: OpenFAST
Component/s: None
Affects Version/s: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0
Fix Version/s: 1.1.1

Type: Bug Priority: Default
Reporter: Jacob Northey Assignee: Jacob Northey
Resolution: Fixed Votes: 0
Labels: None


 Description   

I'm using openfast-1.1.0 to load the FIX/FAST template file published by CME, it seems that "ComposedDecimalParser" is having difficulties parsing a DECIMAL node the with following structure:
<decimal name="NetChgPrevDay" id="451"
presence="optional">
<exponent>
</exponent>
<mantissa>
</mantissa>
</decimal>

Below are the stack dump:
----------------------------------------------------
Exception in thread "main" java.lang.NullPointerException
at org.openfast.template.loader.ComposedDecimalParser.createComposedDecimal(ComposedDecimalParser.java:96)
at org.openfast.template.loader.ComposedDecimalParser.parse(ComposedDecimalParser.java:61)
at org.openfast.template.loader.AbstractFieldParser.parse(AbstractFieldParser.java:51)
at org.openfast.template.loader.GroupParser.parseFields(GroupParser.java:80)
at org.openfast.template.loader.SequenceParser.parse(SequenceParser.java:52)
at org.openfast.template.loader.AbstractFieldParser.parse(AbstractFieldParser.java:51)
at org.openfast.template.loader.GroupParser.parseFields(GroupParser.java:80)
at org.openfast.template.loader.TemplateParser.parse(TemplateParser.java:46)
at org.openfast.template.loader.AbstractFieldParser.parse(AbstractFieldParser.java:51)
at org.openfast.template.loader.XMLMessageTemplateLoader.load(XMLMessageTemplateLoader.java:124)
at org.openfast.examples.consumer.FastMessageConsumer.<init>(FastMessageConsumer.java:36)
at org.openfast.examples.consumer.Main.main(Main.java:69)

However, the ComposedDecimalParser works correctly when the above node is changed to:

<decimal name="NetChgPrevDay" id="451"
presence="optional">
<exponent/>
<mantissa/>
</decimal>


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