-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add nullability annotations #43
Conversation
I think it's better to add a dependency on Therefore I suggest to add the mentioned dependency instead and add a @NullMarked
package net.fellbaum.jemoji;
import org.jspecify.annotations.NullMarked; With this all types should be declared a NonNull if not otherwise marked as Nullable |
I don't like implicit non-null, I'd rather have either NotNull/Nonnull, or Nullable on the returned types and parameters. As for generic types, they are supported by annotations with |
At least |
Last question though: Do we keep the dependency I think adding a 3 KB dependency isn't too much |
I don't really agree with you on that, but imo null annotations can clutter the code quite a bit in a language thats already very verbose. This is a completely null free library and if a null value is returned, it is a bug. For that reason I don't think it is a big deal to just specify that everything returns NonNull in the package info.
For that case I think we can add the dependency as |
Issues solved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks.
No description provided.