Skip to content

[Misc] Use pattern matching for instanceof in search-solr (SonarCloud java:S6201)#5840

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

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

Conversation

@vmassol

@vmassol vmassol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Replaces instanceof-check-and-cast patterns with Java 16+ instanceof pattern matching in the xwiki-platform-search-solr module, as flagged by SonarCloud rule java:S6201.

This fixes all 21 open java:S6201 issues in the module across 6 files:

  • DefaultSolrUtils.java (11)
  • SolrQueryExecutor.java (3)
  • DefaultLinkStore.java (3)
  • AbstractSolrMetadataExtractor.java (2)
  • SolrIndexEventListener.java (1)
  • SolrIndexInitializeListener.java (1)

All changes are behaviour-preserving (bind a pattern variable and drop the redundant cast). Verified with mvn clean install -DskipTests (Checkstyle + Spoon) on xwiki-platform-search-solr-api and xwiki-platform-search-solr-query.

SonarCloud issues: https://sonarcloud.io/project/issues?id=org.xwiki.platform%3Axwiki-platform&issueStatuses=OPEN&rules=java%3AS6201&files=xwiki-platform-core%2Fxwiki-platform-search%2Fxwiki-platform-search-solr


Generated by Claude Code

… java:S6201)

Replace instanceof-check-and-cast patterns with instanceof pattern
matching in the xwiki-platform-search-solr module, as flagged by
SonarCloud rule java:S6201.

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