SONARJAVA-6788: Implement S9361: Duplicate keys or elements should not be passed to immutable collection factory methods - #5988
Conversation
…mmutable collection factory methods
…nd expand constant comparison
This comment has been minimized.
This comment has been minimized.
…duplicated java.util.Map literal
romainbrenguier
left a comment
There was a problem hiding this comment.
Some changes to make on the rspec side, but the java implementation looks good.
Code Review ✅ Approved 3 resolved / 3 findingsImplements rule S9361 to flag duplicate keys or elements in immutable collection factory methods, resolving infinite recursion on cyclic field initializers and fixing HTML formatting in the metadata. ✅ 3 resolved✅ Quality: HTML 'How to fix it' uses markdown bullets that won't render
✅ Edge Case: resolveExpression can recurse infinitely on cyclic field initializers
✅ Bug: withoutSemantic test expects issues that require semantics
Implementation Status ✅ 1 / 1 issues implemented✅ SONARJAVA-6788 — 1 / 1 objectivesThe PR successfully implements the S9361 rule to detect duplicate keys or elements in Java immutable collection factory methods. ✅ 1 complete
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 |
|




Summary
Map.of(...)andMap.ofEntries(...).Set.of(...)..withoutSemantic()check verifier tests.Links
AI disclosure