[xwiki/xwiki-commons] 855f7b: [Misc] Revert the java:S5785 changes on the equals...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-commons Commit: 855f7bec621b27b456375a624262df2df78ea69e https://github.com/xwiki/xwiki-commons/commit/855f7bec621b27b456375a624262df... Author: Vincent Massol <[email protected]> Date: 2026-07-28 (Tue, 28 Jul 2026) Changed paths: M xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/test/java/org/xwiki/logging/marker/TranslationMarkerTest.java M xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/test/java/org/xwiki/observation/event/ActionExecutionEventTest.java M xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/test/java/org/xwiki/observation/event/CancelableEventTest.java M xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/test/java/org/xwiki/observation/filter/AlwaysMatchingEventFilterTest.java M xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/test/java/org/xwiki/observation/filter/FixedNameEventFilterTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-api/src/test/java/org/xwiki/store/blob/BlobRangeOptionTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-filesystem/src/test/java/org/xwiki/store/blob/internal/FileSystemBlobStoreTest.java Log Message: ----------- [Misc] Revert the java:S5785 changes on the equals() contract tests Converting assertTrue/assertFalse(a.equals(b)) into assertEquals/assertNotEquals in tests that verify the equals()/hashCode() contract changes what is tested. JUnit compares through AssertionUtils.objectsAreEqual(a, b), i.e. a == null ? b == null : a.equals(b), so the call site no longer shows which object is the receiver, and the null case never reaches the equals() implementation under test at all. The observation-api instruction coverage dropped from 0.99 to 0.98 and failed its JaCoCo threshold as a result. The assertions are restored and the reason now lives in the code, as @SuppressWarnings("java:S5785") plus an explanatory comment on the concerned test methods. FileSystemBlobStoreTest lost the same coverage of FileSystemBlobStore#equals() for null and for a foreign type through the java:S3415 argument swap, leaving its instanceof branch never executed; it now calls equals() explicitly too. 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