Skip to content

Conversation

PG342
Copy link

@PG342 PG342 commented Sep 15, 2025

Returning null by a method having return type as a HashMap, demands extra check for nullity which can be complex. Instead of that, we can simply pass an empty HashMap of required type to ensure smooth execution.

@PG342
Copy link
Author

PG342 commented Sep 15, 2025

Hi Maintainer, please review the PR raised by me for the issue "Return an empty map instead of null.

Empty arrays and collections should be returned instead of null"
[java:S1168] (https://sonarcloud.io/organizations/acrolinx/rules?open=java%3AS1168&rule_key=java%3AS1168)

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.

1 participant