Skip to content

[Misc] Fix 28 SonarCloud issues in various modules - #1852

Merged
vmassol merged 1 commit into
masterfrom
claude/nifty-bell-yatied
Jul 28, 2026
Merged

[Misc] Fix 28 SonarCloud issues in various modules#1852
vmassol merged 1 commit into
masterfrom
claude/nifty-bell-yatied

Conversation

@claude

@claude claude Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes 28 SonarCloud issues in xwiki-commons, all purely mechanical and behaviour-neutral.

Rules fixed

Rule Count Change
java:S7476 20 "A single-line comment should start with exactly two slashes" — these were all purely decorative ////// banner lines framing a real comment (or standalone separators). Removed them.
java:S3706 8 collection.stream().forEach(x)collection.forEach(x).

Notes

  • No behaviour change: comment-only edits plus an identical Iterable.forEach call.
  • The 30 open java:S3878 issues in xwiki-commons-logging-* were deliberately not touched:
    they are the SLF4J xxx(Marker, String, Object) / xxx(Marker, String, Object, Object) overrides
    that delegate to the varargs overload via new Object[] { ... }. Dropping the array would re-bind
    the call to the fixed-arity overload, i.e. the enclosing method itself — infinite recursion.
  • 8 further sites in xwiki-commons-extension-api were left out: that module currently fails its
    own revapi check on master (java.annotation.removed on IndexedExtension#isCompatible,
    fallout from the recent javax→JSpecify @Nullable migration), which is unrelated to this change
    and would have made the PR red.
  • Verified with mvn clean install -Plegacy,quality (Checkstyle, Revapi, JaCoCo and the unit tests)
    on the 9 modified modules.

Related

Same sweep in the sibling repos:


Generated by Claude Code

* java:S7476 (20): remove decorative `//////` banner comment lines
* java:S3706 (8): replace `.stream().forEach()` with `.forEach()`

Co-Authored-By: Vincent Massol <vincent@massol.net>
@claude claude Bot added the llm-agent PR created by an LLM agent label Jul 28, 2026
@claude claude Bot assigned vmassol Jul 28, 2026
@claude claude Bot locked as resolved and limited conversation to collaborators Jul 28, 2026
@vmassol

vmassol commented Jul 28, 2026

Copy link
Copy Markdown
Member

@tmortagne I think you're the one using several / characters in code comments such as ////////////////////. They're removed in this PR because they trig somejava:S7476 as indicated in the desc of this PR.

Let me know if instead of removing them you'd want to use something like //--------------- instead. Personally I prefer the removal.

Thx

PS: I'm applying the PR but can still change the code afterwards

@vmassol
vmassol merged commit f47e8b4 into master Jul 28, 2026
3 checks passed
@vmassol
vmassol deleted the claude/nifty-bell-yatied branch July 28, 2026 08:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

llm-agent PR created by an LLM agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant