While implementing regression tests for the Nanosat MO Framework I found out that objects of the types URI and Identifier are initialized with the values null when created with their default constructor. Furthermore, the constructor URI/Identifier(String) checks if the provided String is a null reference, but only logs the incident and does not initialize the underlying value in any way.
Therefore, objects created with the default constructor or initialized with a null String cause a NullPointerException when you try to call the method hashCode (which happens for example when you want to use an Identifier as the key of a HashMap).
In the branch 'fix_structures' I provided a possible fix which makes the code a little bit more robust, by initializing the values of Identifier and URI with empty String objects, if nothing/null is provided to the constructor. I will open a pull request, so you can review the changes and apply the patches to the code.
While implementing regression tests for the Nanosat MO Framework I found out that objects of the types URI and Identifier are initialized with the values null when created with their default constructor. Furthermore, the constructor URI/Identifier(String) checks if the provided String is a null reference, but only logs the incident and does not initialize the underlying value in any way. Therefore, objects created with the default constructor or initialized with a null String cause a NullPointerException when you try to call the method hashCode (which happens for example when you want to use an Identifier as the key of a HashMap).
In the branch 'fix_structures' I provided a possible fix which makes the code a little bit more robust, by initializing the values of Identifier and URI with empty String objects, if nothing/null is provided to the constructor. I will open a pull request, so you can review the changes and apply the patches to the code.