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

Avoid returning null. Prefer Optional #63

Open
randykerber opened this issue Nov 28, 2017 · 1 comment
Open

Avoid returning null. Prefer Optional #63

randykerber opened this issue Nov 28, 2017 · 1 comment

Comments

@randykerber
Copy link
Contributor

In situations where a value might not exist, generally preferable to return values wrapped with a Java Optional<> rather than a null. It's more self documenting, and generally easier to deal with logic to handle situations where values might be missing.

@stain
Copy link
Member

stain commented Nov 30, 2017

Yes, no deliberate null returns. Which places did you identify this?

null might still make sense as input parameter though.

@egonw egonw added this to the 2.4.0 milestone Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants