-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unmarshaling causes NPE when enumerations not found #13
Comments
@austinarrowsmith Issue #9 certainly supports your NPE issue. EntityTypes are created with a default PlatformDomain.OTHER which certainly isn't correct if another Domain is desired without specifically setting that Domain. We're taking a look at if forcing a "Domain" at instantiation time is the behavior we intend. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current implementation of unmarshaling PDUs performs some enumeration lookups of the extracted values. If the value isn't found, it returns a
null
. This causes issues later in determining theunmarshalledSize()
of the PDU, resulting in aNullPointerException
(NPE).One such scenario is seen in #14. ie: When some of the values are high end shorts (read as negative values), resulting in a failed enumeration lookup (no negative mappings in the enumeration classes), which returns a null for that instance. Later the parent object requests a
.getMarshalledSize()
, which performs the same thing on all member objects, and as one is anull
the method bombs out.But, as a lot of the Enumerations are filled with holes / incomplete, it's very easy to pull out a value that results in the
null
.Example
In
BeamStatus.java:getMarshalledSize()
:Sure, this particular example should be either on or off, but due to how it is unmarshalled, I've seen other values extracted from the byte. This could be related to the next issue (#7 ) though.
There are other PDUs though, such as the name of an emitter / radio / etc where it may not exist either.
Suggestion
If the mapping is insisted at PDU generation time, perhaps ensure that allgenerated Enumeration classes from the SISO standard (SISO-REF-010-v28 at time of viewing) contain an "unknown"/"invalid"/"other" mapping, and return that instead of
null
? Some already do, but not all.The text was updated successfully, but these errors were encountered: