-
Notifications
You must be signed in to change notification settings - Fork 28
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
[Bugfix] Files in SubmodelElementLists and NullPointerException when serializing/deserializing empty files #250
Conversation
Thanks a lot for providing this bugfix. Would it be possible to provide a test case illustrating that the issue has been fixed? |
If I understand it correctly, the empty files issue is in the AASXSerializer. Would it be possible to move this test case to the TestAASXSerializer? Additionally, the test does not test the issue correctly. After reverting the code in AASX(De)Serializer, emptyFiles still passes. |
I fixed the null test to test the issue. The null issue occured for me in the Deserializer, however, the Deserializer tests utilize the Serializer. When I add an empty file in the SerializerTest, no issue occurs. EDIT: I changed the serializer test to AASFull which leads to java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "path" in the reverted code. |
provokes java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "path" is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some unused imports now in AASXDeserializer, AASXSerializer & AASXSerializerTest that lead to warnings. Would it be possible to remove them? I will gladly merge after the warnings are removed and the other comment is addressed.
...rmat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java
Outdated
Show resolved
Hide resolved
Thanks a lot! |
When a File had an empty value, a NullpointerException would occur in both AASXDeserializer and AASXSerializer. This is now filtered out with file.getValue != null
Additionally, Files in SubmodelElementLists were not included in the fileList. This was fixed by using the Visitor to get all files.