Branch: refs/heads/misc-fix-s2259-npes-oldcore Home: https://github.com/xwiki/xwiki-platform Commit: d911ba9e165db53b1f6030ac1cff052e5af74eac https://github.com/xwiki/xwiki-platform/commit/d911ba9e165db53b1f6030ac1cff0... 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 * 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