[xwiki/xwiki-commons] da9af3: [Misc] Fix SonarCloud javabugs:S2259 false positiv...
Branch: refs/heads/misc-sonar-xml-factory-null-analysis Home: https://github.com/xwiki/xwiki-commons Commit: da9af30cf571c30c2c5b437e8ec5d5421992c4b4 https://github.com/xwiki/xwiki-commons/commit/da9af30cf571c30c2c5b437e8ec5d5... Author: Vincent Massol <[email protected]> Date: 2026-08-27 (Thu, 27 Aug 2026) Changed paths: M xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-xml/src/main/java/org/xwiki/filter/xml/internal/input/XMLInputFilterStreamUtils.java M xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-xml/src/main/java/org/xwiki/filter/xml/internal/output/XMLOutputFilterStreamUtils.java Log Message: ----------- [Misc] Fix SonarCloud javabugs:S2259 false positives in the XML filter stream utils (SonarQube) * The single-argument createXMLEventReader()/createXMLStreamWriter() methods passed the default static factory to their two-argument overload, which then ran it through the null check of getXMLInputFactory()/getXMLOutputFactory(). Null analysis followed that path, concluded that the default factory could be null and reported a guaranteed NullPointerException on the calls dereferencing it. * Pass null instead, which is the documented way of asking for the default factory, so the default factory no longer flows through a null check. The behaviour is unchanged. * Also fix the output side, which has the same shape but was not reported yet. 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-commons/settings/notifications
participants (1)
-
XWiki Notifications