Skip to content

[Misc] Use pattern matching for instanceof in eventstream (SonarCloud java:S6201)#5838

Open
vmassol wants to merge 1 commit into
masterfrom
claude/vigilant-dirac-eu72tr
Open

[Misc] Use pattern matching for instanceof in eventstream (SonarCloud java:S6201)#5838
vmassol wants to merge 1 commit into
masterfrom
claude/vigilant-dirac-eu72tr

Conversation

@vmassol

@vmassol vmassol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Fixes 32 open SonarCloud java:S6201 issues ("Replace this instanceof check and cast with 'instanceof ... '") across the xwiki-platform-eventstream module.

Each instanceof check followed by a redundant cast is rewritten to use an instanceof pattern variable (Java 16+), removing the explicit cast (and, where present, the redundant local variable declaration).

Modules touched:

  • xwiki-platform-eventstream-api (14 sites, 14 files)
  • xwiki-platform-eventstream-default (8 sites, 3 files)
  • xwiki-platform-eventstream-store-solr (10 sites, 1 file)

All 32 flagged sites were converted (0 dropped). Behaviour-preserving; the three modules build cleanly (mvn clean install -DskipTests, which runs Checkstyle + Spoon).

SonarCloud query: https://sonarcloud.io/project/issues?id=org.xwiki.platform%3Axwiki-platform&rules=java%3AS6201&issueStatuses=OPEN


Generated by Claude Code

… java:S6201)

* Replace instanceof-check-plus-cast with instanceof pattern variables
  across the eventstream API, default and Solr-store modules.

Co-Authored-By: Vincent Massol <vincent@massol.net>
@vmassol vmassol added the llm-agent To be used for PRs created autonomously by LLM agents. label Jul 14, 2026 — with Claude
@vmassol vmassol self-assigned this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-agent To be used for PRs created autonomously by LLM agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant