Branch: refs/heads/misc-onevent-switch-dispatch Home: https://github.com/xwiki/xwiki-platform Commit: a1fb512963831771ad91ca79cc0836bed4f3d891 https://github.com/xwiki/xwiki-platform/commit/a1fb512963831771ad91ca79cc083... Author: Vincent Massol <[email protected]> Date: 2026-09-21 (Mon, 21 Sep 2026) Changed paths: M xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java A xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/XWikiEventListenerTest.java Log Message: ----------- [Misc] Simplify the event dispatch of the XWiki event listener * The switch introduced when the if/else chain of `XWiki#onEvent` was converted kept the XObject property handling inside its default branch. That branch therefore performed a second `instanceof` on the value the switch had just dispatched on, and cast the event source to an `XWikiDocument` for every event that matched none of the other cases. * Turn it into a `case XObjectPropertyEvent` delegating to a named method, so the cast happens on the branch that established the type, and leave a default whose empty block carries the reason it is empty. * Add the missing tests: neither the invalidation of the backlinks cache nor the list of events the listener registers was covered. 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-platform/settings/notifications