Details
-
Type: Bug
-
Status: Closed
-
Priority: Trivial
-
Resolution: Fixed
-
Affects Version/s: 1.1.0
-
Fix Version/s: 1.2.1
-
Component/s: Metadata/Specs
-
Labels:None
Description
isMsgField uses single & after a null check - since & doesn't short circuit it throws null pointer if fields is null.
Change from:
public boolean isMsgField(String msgType, int field)
{ Set fields = (Set) messageFields.get(msgType); return fields != null & fields.contains(new Integer(field)); }to
public boolean isMsgField(String msgType, int field)
{ Set fields = (Set) messageFields.get(msgType); return fields != null && fields.contains(new Integer(field)); }Unit test - add the following to DataDictionaryTest.testDictionary()
assertFalse(dd.isMsgField("UNKNOWN_TYPE", 1));