[Misc] Fix a batch of SonarCloud issues - #1848
Merged
Merged
Conversation
Member
Author
|
Note: Test using kimi code (with k3) |
…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>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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/mainchanges (try-with-resources inAbstractFileLoggerTail,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) + checkstyledefaultandblockerexecutions, 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 inInfinispanCacheFactory— try-with-resources would change close-exception semantics).Generated with Kimi Code (AI-assisted; changes reviewed and verified locally).