Skip to content

[Misc] Fix various SonarQube issues - #398

Merged
vmassol merged 1 commit into
masterfrom
claude/peaceful-archimedes-gcoqad
Aug 2, 2026
Merged

[Misc] Fix various SonarQube issues#398
vmassol merged 1 commit into
masterfrom
claude/peaceful-archimedes-gcoqad

Conversation

@claude

@claude claude Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Jira URL

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

Changes

Description

Small mixed SonarCloud cleanup in xwiki-rendering — this repo's remaining mechanical pool is thin,
so this PR is a handful of one-off fixes rather than a single-rule sweep.

Rule What was done Site
java:S1117 Rename the pattern variable macroDescriptorabstractMacroDescriptor, which hid the field of the same name AbstractMacro L261
java:S1117 Rename the local parameterswikiParameters, which hid the field of the same name MacroInfo L82
java:S2094 Delete the empty, unreferenced AbstractXWikiSyntaxResourceRenderer …internal.renderer.xwiki20
java:S4719 Use StandardCharsets.UTF_8 instead of the "UTF-8" charset name TestDataParser L75
java:S8714 Use assertThrows() instead of try/catch and fail() DeprecatedSyntaxConverterTest L62

Clarifications

  • S2094AbstractXWikiSyntaxResourceRenderer is an empty public abstract class with no
    members and no references anywhere in the code base (verified by a repo-wide grep), in an
    internal package, so deleting it is not a backward-compatibility concern. The sibling S2094
    issue on FootnoteMacroParameters was not fixed: its Javadoc states the class is deliberately
    empty because "the rendering engine requires specifying a class for parameters".
  • S1117 — both are local/pattern-variable renames confined to a single method; no signature or
    API changes.
  • Two other rendering issues were analysed and deliberately left open:
    java:S4973 on
    DefaultMacroContentParser L124 — the == is a deliberate identity check, documented by the
    comment right above it, so equals() would change behaviour; and java:S5976 (merge 3 tests into
    a parameterized one), which is a judgement call rather than a mechanical fix.

Screenshots & Video

N/A — no UI change.

Executed Tests

cd xwiki-rendering && mvn install -Plegacy,quality -pl \
  xwiki-rendering-legacy/xwiki-rendering-legacy-api,\
  xwiki-rendering-syntaxes/xwiki-rendering-syntax-xwiki20,\
  xwiki-rendering-test,\
  xwiki-rendering-transformations/xwiki-rendering-transformation-macro,\
  xwiki-rendering-wikimodel

BUILD SUCCESS in 3:03 — Tests run: 454, Failures: 0, Errors: 0, Skipped: 0.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None — cleanup only, no need to backport.

Related: part of one cross-repo SonarCloud sweep — see the sibling PRs in xwiki-commons and xwiki-platform.


Generated by Claude Code

* java:S1117: rename two local variables hiding a field
* java:S2094: remove an unused empty abstract class
* java:S4719: use StandardCharsets.UTF_8 instead of the "UTF-8" charset name
* java:S8714: replace the try/catch/fail() idiom with assertThrows()

Co-Authored-By: Vincent Massol <vincent@massol.net>
@claude claude Bot added the llm-agent label Aug 2, 2026
@claude claude Bot assigned vmassol Aug 2, 2026
@claude claude Bot locked as resolved and limited conversation to collaborators Aug 2, 2026
@vmassol
vmassol merged commit db6ec2c into master Aug 2, 2026
3 checks passed
@vmassol
vmassol deleted the claude/peaceful-archimedes-gcoqad branch August 2, 2026 08:50
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