[Misc] Fix SonarQube issues java:S1066 and java:S5778 - #403
Open
claude[bot] wants to merge 1 commit into
Open
Conversation
* Merged a nested `if` with its enclosing one * Extracted the extra invocation out of an `assertThrows` lambda 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
Fixes the two remaining mechanical SonarCloud issues in this repository.
java:S1066if (this.content == null)into its enclosingif (isContentChecked())inAbstractBoxMacro, keeping both explanatory comments above the merged conditionjava:S5778new WordBlock("not existing")out of theassertThrowslambda inBlockTestso onlyreplaceChild()can throw inside itOpen issues for these rules on SonarCloud
Clarifications
java:S1066change is behaviour-preserving: the innerifwas the only statement in theouter one and there is no
elseon either, soA && Bis exactly the original control flow.they are refactors or API changes rather than cleanups:
java:S127(13, loop-counterreassignment),
java:S3252(34, static-access qualifier — renaming the qualifier loses whichparser's escape char is meant),
java:S5961(assertion counts),java:S6035(2 — the flaggedregexes are
public static final Stringconstants, so changing their value is a RevapiconstantValueChangedbreak),java:S3415(2 — one of the two files already carries a@SuppressWarnings("java:S5785")comment explicitly warning that swapping those arguments wouldstop testing the
equals()contract), and the singlesrc/mainjava:S1130.Screenshots & Video
N/A
Executed Tests
BUILD SUCCESS— 440 tests run, 0 failures, 0 errors, 0 skipped.Expected merging strategy
Squash and merge into
master. No backport needed.Related
Part of one SonarQube sweep across the three repositories:
Generated by Claude Code