SONARJAVA-5553 Raise only when returned mutable actually reaches outside the class for S2384#5136
Merged
romainbrenguier merged 5 commits intomasterfrom May 16, 2025
Merged
Conversation
erwan-serandour
requested changes
May 8, 2025
| /** | ||
| * Maps method that return the result of another method | ||
| */ | ||
| private final Map<String, String> passingThroughMethod = new HashMap<>(); |
Contributor
There was a problem hiding this comment.
methods can have several returns
5d9e398 to
d1cb097
Compare
39e37dc to
3b1ed31
Compare
erwan-serandour
approved these changes
May 16, 2025
erwan-serandour
requested changes
May 16, 2025
…pe the class scope This is to reduce FPs where a mutable field is returned by a private method but this value is only used within the class and never escapes.
3b1ed31 to
85dbec3
Compare
|
erwan-serandour
approved these changes
May 16, 2025
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.




https://sonarsource.atlassian.net/browse/SONARJAVA-5553
This is to reduce FPs where a mutable field is returned by a private method but this value is only used within the class and never escapes.