Skip to content
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

Robustness - library crashes because of a null return when a field value is undefined #152

Open
Cabisnotavailable opened this issue Jun 3, 2024 · 0 comments
Labels

Comments

@Cabisnotavailable
Copy link

In the standard "SISO-REF-010" there are lists containing defined DIS field-values.
For example there are "Electromagnetic Emitters [UID 75]", which is a 16-bit enumeration with possible values between zero and 65535.
Not all possible values have a counterpart.
Excerpt from SISO-REF-010-2023:

2 1245/6X
3 1L117
4 1L121E
5 1L250
6 1L220-U
7 1L122-1E
10 1RL138
12 5N20
14 5P-10 Puma
15 5P-10E Puma
...

As you can see there are no counterparts for the numbers 0,1,8,9,11 and so on. On top of that these lists get updated almost every year.
In a theater simulation we cannot assume that all simulation systems are up to date and use the same SISO Ref Tables.

Here is an example error report from Open DIS when using it in a real world simulation environment:
No corresponding enumeration found for value 1 of enum EmitterName java.lang.NullPointerException: Cannot invoke "edu.nps.moves.dis7.enumerations.EmitterName.getValue()" because the return value of "edu.nps.moves.dis7.pdus.EmitterSystem.getEmitterName()" is null

The library is non-responsing from this moment on and you have to restart the application.

It is caused by a simulation software in this network that uses the enum 1. It shouldn't, regarding the standard, but it does.
The error makes sense as the value 1 is undefined, but it shouldn't crash the Open DIS library.

@leif81 leif81 added the bug label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants