[FAST-7] GroupValue.isDefined should handle undefined fields correctly Created: 24/Oct/08 Updated: 24/Oct/08 Resolved: 24/Oct/08 |
|
Status: | Resolved |
Project: | OpenFAST |
Component/s: | Message Object Model |
Affects Version/s: | 1.0.0 |
Fix Version/s: | 1.0.1 |
Type: | Improvement | Priority: | Minor |
Reporter: | Dale Wilson | Assignee: | Jacob Northey |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Environment: |
WinXP SP3; JavaSE 1.5; OpenFAST from SVN trunk. |
Description |
A call to GroupValue.isDefined giving a field name that is not mentioned in the template used to encode/decode the message results in an IllegalArgumentException. The exception is misleading because the field might be defined when other templates are used to transmit this particular message type. isDefined() should simply return "false" if the field is not declared in the template meaning the field is not included in this instance of the message. The following stack trace shows an occurrence of this problem: Exception in thread "main" java.lang.IllegalArgumentException: The field "MDEntryID" does not exist in group MDEntries The field MDEntryID is defined for the Market Data Incremental Refresh message being decoded here (see "FIX 4.4 with Errata 20030618 Volume 3" page 68, but this particular counterparty doesn't this optional field so they omitted it from their template. -------- private boolean fieldPresent(GroupValue groupValue, String fieldName) { return groupValue.getGroup().hasField(fieldName) && groupValue.isDefined(fieldName); } |