-
Notifications
You must be signed in to change notification settings - Fork 26
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
Existence of @NonNull
#230
Comments
The disadvantages so far look kinda slight.
Honestly those all look pretty good to do, tho. If not the "non-null projection" one, that's still okay: to decide against it means we'd have figured that the awkwardness of having to deal with meaningless
So we just have to deal with that in documentation. People who didn't encounter that information will think and do wrong things, but probably not too harmfully. But I can see alluding to its "notallthatness" in its javadoc summary sentence. Basically this problem seems manageable to me right now.
(that is extremely minor) |
I suspect that Kotlin is more or less going to "force" us to add this eventually, as kevinb9n says above. I still think that it would be good for me to lay out in more detail specifically the ways I've seen people confused by (It sounds like we now have an offer from Artem to share some similar experiences. Yay!) One thing that I'd like to someday consider is whether we could pick a different name so as to better discourage people from using it unless they really need it. But it may be hard to find a good name. The name is already filed as a separate issue, but I want to flag it here as something to consider as a way to fight the misuse that I worry about. |
@artempyanykh If you could share experiences about how this annotation has distracted/confused your users. |
Sure, a bit about our experience.
However, I wouldn't go as far to say that |
Note: I've edited the top comment for clarity considerably; the changes don't seem to me to render any following comments confusing, so I haven't switched to "keep both original and updated text separated by a line" mode. You can of course view all the past versions if necessary. How best to use editing here is an in-progress experiment. |
Just a note that if we create an 0.3 milestone I would expect to keep this one 1.0. |
I'm increasingly convinced that Kotlin's Given that, I think I would actually argue in favor of putting |
I'm with you. Ooh can I write it?
|
I am pretty much always in favor of "kevinb writes user documentation" :) (and the 4 lines of boilerplate code that goes along with the docs :)) |
I think we don't have a significant argument against this, and we need to at least put it in 0.3 to see how it goes. |
@NonNull
@NonNull
[working decision: yes]
Working decision: yes, we will have |
Current decision: Yes. Argument for changing: None. Timing: This must be decided before version 1.0 of the jar. Proposal for 1.0: Finalize the current decision. If you agree, please add a thumbs-up emoji (👍) to this comment. If you disagree, please add a thumbs-down emoji (👎) to this comment and briefly explain your disagreement. Please only add a thumbs-down if you feel you can make a strong case why this decision will be materially worse for users or tool providers than an alternative. Results: This proposal received six 👍s and no other votes. It is finalized. I'll edit the title to reflect that. |
Decision: Yes, |
@NonNull
[working decision: yes]@NonNull
This issue
This issue is about the yes/no decision to add a
@NonNull
type-use annotation to the artifact.How these issues are organized
Significant use cases whose expected solution requires this annotation are filed separately:
Compatibility note
Use cases
Known use cases for which at least one plausible solution would require this annotation:
@UnspecifiedNullness
) #137, which does NOT need this annotation. BUT, if we are no on 137, then at least this (Ability to indicate that a single type usage (in null-unmarked context) is known non-nullable #229) would provide a gross workaround.T!!
types in Kotlin-generated class files (i.e. kotlinc would write this annotation). Not filed.Other small advantages
@NonNull
and their IDE may grab one from wherever (still happens with other spellings anyway though)Disadvantages
@NonNull
citing use cases that don't actually need it.)String
is intrinsically non-nullable.@Nullable @NonNull
(this is extremely minor)Design
Naming it is #44, currently closed favoring
@NonNull
History
#4
The text was updated successfully, but these errors were encountered: