Skip to content

[Misc] Fix various mechanical SonarQube issues in the rendering modules - #393

Merged
vmassol merged 1 commit into
masterfrom
claude/peaceful-archimedes-y11smm
Jul 31, 2026
Merged

[Misc] Fix various mechanical SonarQube issues in the rendering modules#393
vmassol merged 1 commit into
masterfrom
claude/peaceful-archimedes-y11smm

Conversation

@claude

@claude claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Jira URL

None — this is a [Misc] SonarQube cleanup commit.

Changes

Description

Fixes 9 open SonarCloud issues in xwiki-rendering, all purely mechanical and
behaviour-preserving.

Rule # Change
java:S5361 8 replaceAll()replace() where the pattern is a plain literal (the accent-transliteration table in XWikiSerializer2)
java:S1066 1 merge collapsible nested if in ParserUtils

Open issues for this project on SonarCloud

Clarifications

  • Only calls whose first argument reduces to a literal were converted: the single-character
    "\uXXXX" patterns, and replaceAll("\\.", "") which becomes replace(".", "") — the escaped
    regex dot is the literal dot. None of the replacement strings contain $ or \, which are the
    only characters whose meaning differs between replaceAll and replace. The remaining
    replaceAll calls in that method use real character classes and were left alone.
  • The ParserUtils merge folds if (block instanceof MacroBlock macro) { if (!macro.isInline()) }
    into a single condition; the inner if was the sole statement of the outer one and there is no
    else.

Screenshots & Video

No UI change.

Executed Tests

mvn install -Plegacy,quality of xwiki-rendering-api and xwiki-rendering-wikimodel
BUILD SUCCESS, 562 tests, 0 failures, 0 errors.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None — master only.

Related

Part of the same SonarQube sweep:


Generated by Claude Code

* java:S5361: use replace() instead of replaceAll() for plain literal patterns (8)
* java:S1066: merge collapsible nested if statements (1)

Co-authored-by: Vincent Massol <vincent@massol.net>
@claude claude Bot added the llm-agent label Jul 31, 2026
@claude claude Bot assigned vmassol Jul 31, 2026
@claude claude Bot locked as resolved and limited conversation to collaborators Jul 31, 2026
@vmassol
vmassol merged commit 9f81a3b into master Jul 31, 2026
3 checks passed
@vmassol
vmassol deleted the claude/peaceful-archimedes-y11smm branch July 31, 2026 07:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant