Skip to content

[Misc] Use pattern matching for instanceof in security modules (SonarCloud java:S6201)#5843

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

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

Conversation

@vmassol

@vmassol vmassol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Replaces instanceof checks followed by explicit casts with pattern matching for instanceof, as flagged by SonarCloud rule java:S6201.

Fixes 20 issues across two leaf modules:

  • xwiki-platform-security-authorization-api (SecurityReference, DefaultAuthorizationManager, RightMap, RightSet, DefaultSecurityCache)
  • xwiki-platform-security-requiredrights-default (RequiredRightsChangedResult, AbstractMacroBlockRequiredRightAnalyzer, ScriptMacroAnalyzer)

All changes are behaviour-preserving mechanical refactorings; both modules build cleanly (install, Checkstyle + Spoon included).

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


Generated by Claude Code

…Cloud java:S6201)

* Replace instanceof checks followed by casts with pattern matching for
  instanceof in xwiki-platform-security-authorization-api and
  xwiki-platform-security-requiredrights-default.

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