[xwiki/xwiki-platform] c85b51: [Misc] Make the optional OSV list fields never nul...
Branch: refs/heads/misc-osv-optional-list-fields Home: https://github.com/xwiki/xwiki-platform Commit: c85b51555960a96524df73a52db981b25298f529 https://github.com/xwiki/xwiki-platform/commit/c85b51555960a96524df73a52db98... Author: Vincent Massol <[email protected]> Date: 2026-08-03 (Mon, 03 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-index/src/main/java/org/xwiki/extension/security/internal/analyzer/osv/model/response/AffectObject.java M xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-index/src/main/java/org/xwiki/extension/security/internal/analyzer/osv/model/response/VulnObject.java M xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-index/src/test/java/org/xwiki/extension/security/internal/analyzer/osv/model/response/AffectObjectTest.java M xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-index/src/test/java/org/xwiki/extension/security/internal/analyzer/osv/model/response/VulnObjectTest.java Log Message: ----------- [Misc] Make the optional OSV list fields never null instead of null-checking the getters Following Simon's review: returning List.of() from the getter when the field is absent made the returned list immutable in that case and mutable (the live internal list) otherwise, and left the field itself null. The ranges, affected and references fields are now initialized to an empty list and the getters are back to returning the field directly. The setters store null as an empty list too, so that an explicit null in the JSON response (which Jackson routes to the setter, bypassing the field initializer) cannot reintroduce the NPE. VulnObject#getAliases() is aligned to the same pattern, replacing its lazy initialization in the getter. Its observable behaviour is unchanged since it was already never returning null. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications