Skip to content

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

Merged
vmassol merged 1 commit into
masterfrom
claude/peaceful-archimedes-lm4cfw
Jul 30, 2026
Merged

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

Conversation

@claude

@claude claude Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Mechanical SonarCloud cleanup across xwiki-rendering-api, xwiki-rendering-wikimodel,
xwiki-rendering-transformation-linkchecker22 issues, no behaviour change:

  • java:S6397 (8) — drop redundant single-character regex character classes in
    XWikiSerializer2 ("[IJ]""IJ", "[\\.]""\\.").
  • java:S6485 (3) — use LinkedHashMap.newLinkedHashMap(n) instead of the constructor taking an
    initial capacity.
  • java:S6208 (4) — merge fall-through case labels into comma-separated labels.
  • java:S6204 (2) — Stream.toList() instead of collect(Collectors.toList()). Both sites are
    safe: ListenerRegistry already returns an unmodifiable List.of() on its other branch, and the
    XhtmlHandler list is copied by the WikiParameters(Collection) constructor.
  • java:S2864 (1) — iterate entrySet() instead of keySet() + get().
  • java:S1161 (1) — add a missing @Override.
  • java:S1481 / java:S1068 (2) — remove an unused local variable and an unused private field.
  • java:S1126 (1) — replace an if-then-else returning booleans with a single return.

Verified with mvn install -Plegacy,quality on xwiki-rendering-api, xwiki-rendering-wikimodel,
xwiki-rendering-transformation-linkchecker and xwiki-rendering-syntax-xhtml (the module whose
tests exercise the wikimodel XHTML parser changes) — all green.

Related (same sweep, one PR per repo):


Generated by Claude Code

* java:S6397: drop redundant single-character regex character classes
* java:S6485: use the HashMap/LinkedHashMap.newXxx() factory methods
* java:S6208: merge fall-through case labels into comma-separated labels
* java:S6204: use Stream.toList() instead of collect(Collectors.toList())
* java:S2864: iterate entrySet() instead of keySet() + get()
* java:S1161: add a missing @OverRide annotation
* java:S1481/java:S1068: remove an unused local variable and an unused private field
* java:S1126: replace an if-then-else returning booleans with a single return

Co-Authored-By: Vincent Massol <vincent@massol.net>
@claude claude Bot added the llm-agent label Jul 30, 2026
@claude claude Bot assigned vmassol Jul 30, 2026
@claude claude Bot locked as resolved and limited conversation to collaborators Jul 30, 2026
@vmassol
vmassol merged commit 4e40352 into master Jul 30, 2026
3 checks passed
@vmassol
vmassol deleted the claude/peaceful-archimedes-lm4cfw branch July 30, 2026 07:47
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