[xwiki/xwiki-platform] 1f165d: [Misc] Fix the SonarQube-reported NPE risks blocki...
Branch: refs/heads/stable-17.10.x Home: https://github.com/xwiki/xwiki-platform Commit: 1f165d28611e2bd0523c8dbab215396913f993cf https://github.com/xwiki/xwiki-platform/commit/1f165d28611e2bd0523c8dbab2153... Author: Vincent Massol <[email protected]> Date: 2026-07-26 (Sun, 26 Jul 2026) Changed paths: M xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-api/src/main/java/org/xwiki/livedata/internal/DefaultLiveDataConfigurationResolver.java 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/pdf/impl/FileSystemURLFactory.java M xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-default/src/main/java/org/xwiki/rendering/async/internal/AsyncRendererCacheListener.java M xwiki-platform-core/xwiki-platform-scheduler/xwiki-platform-scheduler-api/src/main/java/com/xpn/xwiki/plugin/scheduler/SchedulerPlugin.java M xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/script/WysiwygEditorScriptService.java Log Message: ----------- [Misc] Fix the SonarQube-reported NPE risks blocking the quality gate (#5981) * [Misc] Fix sonarqube-reported issues that block the quality gate The three JavaScript files touched by the original commit (attachments.js, locationPicker.js, upload.js) are left out: on this branch they still use the pre-ES6 Prototype.js form, so the lines the original commit rewrote either do not exist here or sit in a differently-shaped function. Their changes are cosmetic rule cleanups (parseInt -> Number.parseInt, replace -> replaceAll) that do not affect this branch's quality gate. Use the "status" literal instead of the STATUS constant in SchedulerPlugin, which this branch does not declare. (cherry picked from commit 630fe598748109ba75f6de268c972ad08c5c3ce3) * [Misc] Fix additional SonarQube-reported NPE risks blocking the quality gate * FileSystemURLFactory: instead of null-checking the file mapping at each call site, make getFileMapping() lazily create and store the mapping in the context, so it's always non-null and callers' mutations still persist. * WysiwygEditorScriptService: handle the null source reference in a single place (the 4-arg overload) rather than short-circuiting in the deprecated 2-arg overload. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> (cherry picked from commit d33553c3cc47461cb9fc0d3a95b6b2369667c562) * [Misc] Fix remaining SonarQube-reported NPE risks blocking the quality gate * copyAttachment: getXWikiContext() can return null, so reuse the captured context and guard the author reference lookup instead of dereferencing a possibly-null context a second time. * backupContext: require a non-null context up front, since all the data backed up below is read from it. * Annotate getXWikiContext() with @Nullable to document that it can return null (which is what makes the direct dereferences above unsafe). (cherry picked from commit de737018e980d44e177dcf801c5e13d2239a2ba5) --------- Co-authored-by: Claude Opus 4.8 (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