[xwiki/xwiki-platform] 990045: [Misc] Fix three SonarQube javabugs:S2259 null der...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: 990045e2566ce765546c4e616a56fe2c4fcab67c https://github.com/xwiki/xwiki-platform/commit/990045e2566ce765546c4e616a56f... Author: Vincent Massol <[email protected]> Date: 2026-09-03 (Thu, 03 Sep 2026) Changed paths: M xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java M xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/BaseCollection.java M xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/doc/XWikiDocumentTest.java M xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/objects/BaseCollectionTest.java Log Message: ----------- [Misc] Fix three SonarQube javabugs:S2259 null dereferences in oldcore (#6299) * BaseCollection: getPropertyDisplayValue() and the plain-value branch beside it dereferenced a property that addOrChangePropertyDiff() explicitly allows to be null. Report the missing property as an empty value, which is how that caller's own comparison already treats it. * XWikiDocument#display(): the @Nullable getXWikiContext() result was passed straight to getTranslatedDocument(XWikiContext), which dereferences it. Require it up front instead, since the translated content, the rendering cache and the display all read from it. * XWikiDocument#restoreContext(): the context read back from the Execution Context by its callers can be missing. Require it after the pop, so that backupContext()'s push is undone whatever happens next, and mirror the requirement backupContext() already makes. 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