[xwiki/xwiki-platform] 0f6352: [Misc] Fix a SonarQube issue: an overflow-prone co...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: 0f63525ebaee1b33002d77d9d9dc4c3ade53fddd https://github.com/xwiki/xwiki-platform/commit/0f63525ebaee1b33002d77d9d9dc4... Author: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Date: 2026-08-29 (Sat, 29 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-api/src/main/java/org/xwiki/resource/AbstractResourceReferenceHandler.java M xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-api/src/test/java/org/xwiki/resource/ResourceReferenceHandlerTest.java Log Message: ----------- [Misc] Fix a SonarQube issue: an overflow-prone compareTo whose test asserts its magnitude (#6258) * java:S9354: AbstractResourceReferenceHandler#compareTo used getPriority() - other.getPriority(); int subtraction wraps on overflow and can then return the wrong sign. Replaced with Integer.compare(). * ResourceReferenceHandlerTest#priority asserted the exact difference (300) rather than its sign, which is not part of the Comparable contract; adapted to assert the sign. Co-authored-by: Vincent Massol <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications