Skip to content

[Misc] Fix a batch of SonarCloud issues - #1848

Merged
vmassol merged 5 commits into
masterfrom
sonarqube-fixes
Jul 27, 2026
Merged

[Misc] Fix a batch of SonarCloud issues#1848
vmassol merged 5 commits into
masterfrom
sonarqube-fixes

Conversation

@vmassol

@vmassol vmassol commented Jul 26, 2026

Copy link
Copy Markdown
Member

Fixes 51 open SonarCloud issues on xwiki-commons, one commit per rule.

All fixes are local and mechanical; most are in test code. The three src/main changes (try-with-resources in AbstractFileLoggerTail, TestDataParser, ZIPFileAssertComparator) preserve close/exception semantics and touch no public API — verified with revapi (mvn -Pquality verify) on both affected modules.

Every touched module was verified: mvn clean install (unit tests pass) + checkstyle default and blocker executions, all green.

java:S1854 — Remove useless assignments to local variables (7)

java:S6126 — Replace String concatenation with text block (3)

java:S3415 — Fix expected/actual assertion argument order (7)

java:S5785 — Use assertEquals/assertNotEquals instead of assertTrue/assertFalse with equals() (29)

java:S2093 — Use try-with-resources (5)

Note: 3 additional candidate issues were triaged and deliberately skipped (2 in SVGDefinitions — deliberate upstream-copied lists; 1 in InfinispanCacheFactory — try-with-resources would change close-exception semantics).

Generated with Kimi Code (AI-assisted; changes reviewed and verified locally).

@vmassol vmassol added the llm-agent PR created by an LLM agent label Jul 26, 2026
@vmassol vmassol self-assigned this Jul 27, 2026
@vmassol

vmassol commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Note: Test using kimi code (with k3)

vmassol and others added 5 commits July 27, 2026 19:07
…S1854)

* Dead stores reported by SonarCloud; side-effecting calls kept as plain statements.

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
…s (SonarQube java:S6126)

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
…va:S3415)

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
…alse with equals() (SonarQube java:S5785)

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
…e java:S2093)

* AbstractFileLoggerTail: extracted the read block into a private helper holding the
  try-with-resources (checkstyle NestedTryDepth); close order and error path unchanged.

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
@vmassol
vmassol merged commit 1091ed5 into master Jul 27, 2026
2 checks passed
@vmassol
vmassol deleted the sonarqube-fixes branch July 27, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-agent PR created by an LLM agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant