[xwiki/xwiki-platform] 5b64fe: [Misc] Fix an unsafe type cast in DocumentReferenc...
Branch: refs/heads/claude/dreamy-franklin-G14oW Home: https://github.com/xwiki/xwiki-platform Commit: 5b64feaacf248b4460781bb8de9c6bcb5af6e917 https://github.com/xwiki/xwiki-platform/commit/5b64feaacf248b4460781bb8de9c6... Author: Claude <[email protected]> Date: 2026-06-07 (Sun, 07 Jun 2026) Changed paths: M xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-api/src/main/java/org/xwiki/model/reference/DocumentReference.java Log Message: ----------- [Misc] Fix an unsafe type cast in DocumentReference#getSpaceReferences reported by SonarQube * SonarQube rule javabugs:S6320 flagged the cast of an EntityReference to SpaceReference while walking the parent chain. The chain elements are typed EntityReference and are not guaranteed to be SpaceReference instances (e.g. when the DocumentReference is built from a generic EntityReference), so the cast could throw a ClassCastException. * Build the SpaceReference from the EntityReference instead, which is safe in all cases and preserves equality (so the returned list is unchanged for the existing scenarios). To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications