Skip to content

[Misc] Fix SonarCloud instanceof-pattern-matching issues in the xml modules - #1849

Merged
vmassol merged 1 commit into
masterfrom
claude/nifty-bell-kj1r6t
Jul 27, 2026
Merged

[Misc] Fix SonarCloud instanceof-pattern-matching issues in the xml modules#1849
vmassol merged 1 commit into
masterfrom
claude/nifty-bell-kj1r6t

Conversation

@claude

@claude claude Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes 34 open SonarCloud issues of rule java:S6201 ("Replace this instanceof check and cast with 'instanceof Foo foo'") in the xwiki-commons-xml and xwiki-commons-filter-xml modules.

Every site binds a pattern variable and drops the now-redundant cast; where an explicit local already held the cast result, that local's name is reused as the pattern variable and its declaration removed. No behaviour change, no API change.

Verified with mvn clean install -Plegacy,quality on both modules (unit tests, Checkstyle, Revapi, Enforcer and the JaCoCo coverage gate all green).

SonarCloud issues fixed

java:S6201 — Replace the instanceof check and cast with instanceof pattern matching (34)

Related

Part of one SonarCloud sweep across the three repositories:


Generated by Claude Code

…ules

* Replace instanceof checks followed by a cast with instanceof pattern matching

Co-Authored-By: Vincent Massol <vincent@massol.net>
@claude claude Bot added the llm-agent PR created by an LLM agent label Jul 27, 2026
@claude claude Bot assigned vmassol Jul 27, 2026
@claude claude Bot locked as resolved and limited conversation to collaborators Jul 27, 2026
@vmassol
vmassol merged commit 816d916 into master Jul 27, 2026
3 checks passed
@vmassol
vmassol deleted the claude/nifty-bell-kj1r6t branch July 27, 2026 06:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

llm-agent PR created by an LLM agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant