Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: return empty collection, empty array or optional instead of null #118

Open
dgroup opened this issue Feb 23, 2022 · 2 comments
Open
Assignees
Labels

Comments

@dgroup
Copy link
Owner

dgroup commented Feb 23, 2022

No description provided.

@dgroup dgroup added this to the 0.2.0 milestone Apr 9, 2022
@dgroup dgroup added the new rule label Apr 9, 2022
@dgroup dgroup removed this from the 0.2.0 milestone Apr 27, 2022
@dykov dykov self-assigned this Oct 20, 2024
@dykov
Copy link
Collaborator

dykov commented Oct 20, 2024

@dgroup,
Please provide more details and examples in which cases the rule should be triggered.
Does this rule mean “never return null from methods”?

@dgroup
Copy link
Owner Author

dgroup commented Oct 21, 2024

@dykov, For cases when method returns

  • array
  • collection
  • class that extends collection

we must use empty collection.
For optional separate rule is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants