Skip to content

Have a list of trusted Java methods with explicitNulls #10379

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

Closed
Lumintorious opened this issue Nov 18, 2020 · 1 comment
Closed

Have a list of trusted Java methods with explicitNulls #10379

Lumintorious opened this issue Nov 18, 2020 · 1 comment

Comments

@Lumintorious
Copy link

Explicit nulls is great and even though you can use .nn and even though unsafeNulls might be coming, some methods in Java classes like File or String that are used in Scala all the time should have a list of trusted (maybe hard-coded) methods that are trusted to not return UncheckedNull. For example, I think there is no instance where calling join, split, substring, trim etc. on Strings with non-null parameters (non-null parameters also not being part of a use-case of the method either) could return null and having to use workarounds that "feel" unsafe when you can be sure that they are safe on methods that you would use all the time is a little cumbersome and makes the code look messy when it shouldn't be.

@bishabosha
Copy link
Member

bishabosha commented Nov 18, 2020

Thank you for your interest, I would say this is a duplicate issue of #7871

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

2 participants