[Misc] Fix various SonarQube issues - #398
Merged
Merged
Conversation
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
macroDescriptor→abstractMacroDescriptor, which hid the field of the same nameAbstractMacroL261parameters→wikiParameters, which hid the field of the same nameMacroInfoL82AbstractXWikiSyntaxResourceRenderer…internal.renderer.xwiki20StandardCharsets.UTF_8instead of the"UTF-8"charset nameTestDataParserL75assertThrows()instead of try/catch andfail()DeprecatedSyntaxConverterTestL62Clarifications
AbstractXWikiSyntaxResourceRendereris an emptypublic abstract classwith nomembers and no references anywhere in the code base (verified by a repo-wide grep), in an
internalpackage, so deleting it is not a backward-compatibility concern. The sibling S2094issue on
FootnoteMacroParameterswas not fixed: its Javadoc states the class is deliberatelyempty because "the rendering engine requires specifying a class for parameters".
API changes.
java:S4973 on
DefaultMacroContentParserL124 — the==is a deliberate identity check, documented by thecomment right above it, so
equals()would change behaviour; andjava:S5976(merge 3 tests intoa parameterized one), which is a judgement call rather than a mechanical fix.
Screenshots & Video
N/A — no UI change.
Executed Tests
BUILD SUCCESSin 3:03 — Tests run: 454, Failures: 0, Errors: 0, Skipped: 0.Expected merging strategy
Related: part of one cross-repo SonarCloud sweep — see the sibling PRs in
xwiki-commonsandxwiki-platform.Generated by Claude Code