SONARJAVA-6660 Fix S2229 FP for self-invocations inside TransactionTemplate callbacks - #6049
Conversation
…emplate callbacks Self-invocations inside TransactionTemplate.execute/executeWithoutResult callbacks are suppressed because the template guarantees an active transaction at the call site. Resolving the template's configured propagation statically would require data-flow or symbolic-execution techniques, so all self-invocations within such callbacks are treated as compliant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9288e1 to
487b7c4
Compare
Code Review ✅ Approved 2 resolved / 2 findingsFixes false positives for rule S2229 by suppressing self-invocations inside ✅ 2 resolved✅ Edge Case: Matcher misses TransactionOperations/subclass receivers, FP persists
✅ Bug: Suppression covers receiver and eager arguments, not just callback
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
lijun-chen-sonarsource
left a comment
There was a problem hiding this comment.
LGTM!
I've seen your counterarguments to Gitar's comments. I think they make sense.
Do you think it'd make sense to add test cases that make explicit that these two cases are FN and FP that we intentionally accept?
I think no. These cases are super-low, there's no need to document them. |




Self-invocations inside TransactionTemplate.execute/executeWithoutResult callbacks are suppressed because the template guarantees an active transaction at the call site. Resolving the template's configured propagation statically would require data-flow or symbolic-execution techniques, so all self-invocations within such callbacks are treated as compliant.