Skip to content

chore: fix trivial SonarQube code smells#13

Merged
codejanovic merged 1 commit into
mainfrom
chore/sonarqube-trivial-cleanup
May 31, 2026
Merged

chore: fix trivial SonarQube code smells#13
codejanovic merged 1 commit into
mainfrom
chore/sonarqube-trivial-cleanup

Conversation

@glaudeee
Copy link
Copy Markdown
Contributor

Summary

Fixes 4 open SonarQube issues across 2 rules:

  • java:S1905 (unnecessary cast) — 3 occurrences in CollectionPredicates.Default: removed redundant (T[]) cast in containsAllOf(T[]), containsAnyOf(T[]), and containsNoneOf(T[]) (lines 88, 98, 108). The varargs parameters are already typed as T[].
  • java:S1118 (missing private constructor) — 1 occurrence in Throws: changed abstract class to final class and added private Throws() {} to prevent implicit public constructor and accidental subclassing. Public static API is unchanged.

Rules NOT touched (explicitly excluded per task)

  • java:S1117 (variable shadowing) — 5 issues in test code, left untouched
  • java:S1135 (TODO comments) — 3 issues, left untouched

Test plan

  • mvn -q -DskipTests compile passes inside devcontainer (no errors, JVM warnings only)
  • Full test suite via CI

🤖 Generated with Claude Code

Remove three unnecessary (T[]) casts in CollectionPredicates.Default
(java:S1905, lines 88/98/108) — the varargs parameters are already typed
as T[] so the cast is redundant.

Add private constructor to Throws utility class and change abstract to
final (java:S1118, line 3) — prevents implicit public constructor and
accidental subclassing while keeping the static API intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@glaudeee glaudeee requested a review from codejanovic as a code owner May 30, 2026 16:44
@codejanovic codejanovic merged commit 14b5e16 into main May 31, 2026
4 checks passed
@codejanovic codejanovic deleted the chore/sonarqube-trivial-cleanup branch May 31, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants