SONARJAVA-6866 Fix S9358: Move conditional expressions inside operations - #6053
Conversation
- AssertThrowsInsteadOfTryCatchFailCheck: move ternary inside Replacements constructor instead of duplicating it - AndroidMobileDatabaseEncryptionKeysCheck: move ternary inside arguments.get() call - JParser: inline ternary into firstTokenAfter() call and extract shared boolean to avoid duplicate e.isUpperBound() calls Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16ea450 to
976ba1d
Compare
Code Review ✅ Approved 1 resolved / 1 findingsMoves conditional expressions inside operations to fix S9358 violations across multiple check classes, addressing the branch reintroduces continue statements it set out to remove finding. All tests pass successfully. ✅ 1 resolved✅ Quality: Branch reintroduces
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|




Summary
AssertThrowsInsteadOfTryCatchFailCheck: move ternary insideReplacementsconstructor (2 occurrences)AndroidMobileDatabaseEncryptionKeysCheck: move ternary insidearguments.get()callJParser: inline ternary intofirstTokenAfter()and extract shared boolean to avoid duplicatee.isUpperBound()calls (2 occurrences)Test plan
AssertThrowsInsteadOfTryCatchFailCheckTestpassesAndroidMobileDatabaseEncryptionKeysCheckTestpassesJParserTestpasses🤖 Generated with Claude Code
Summary by Gitar
HashCodeMismatchedFieldsCheckto use earlycontinuestatements for cleaner loop structureLocalVariablesShouldNotSpanSwitchCaseGroupsCheckusing early returnThis will update automatically on new commits.