[xwiki/xwiki-platform] ce64f7: [Misc] Fix three SonarQube javabugs:S2259 null der...
Branch: refs/heads/stable-17.10.x Home: https://github.com/xwiki/xwiki-platform Commit: ce64f70e47a0e67746e1251ff28c7c29fd2a5001 https://github.com/xwiki/xwiki-platform/commit/ce64f70e47a0e67746e1251ff28c7... Author: Vincent Massol <[email protected]> Date: 2026-09-04 (Fri, 04 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 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]> (cherry picked from commit 990045e2566ce765546c4e616a56fe2c4fcab67c) To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications