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
A general purpose defaulting annotation, like @Default(NotNull.class) #5
Comments
Comments from the document:
|
I know of only two other possible uses for this (and let's NOT debate their inclusion in the project here and now; they are just "potential"): "Caller must use return value of this method" But in both of these cases, I don't see why we couldn't just use the same annotation that we use for a single method at the wider scopes. So I would suggest we plan on a special-purpose annotation for "default not null". |
I'm still going to leave the door open here. There are other examples, like "Caller must close any AutoCloseables returned from this package/class", that I think will make sense. It occurred to me belatedly that defaults are useful for two different reasons:
I wasn't thinking of #2 enough before. My main concern about |
|
Another problem with |
Another possible approach here is to have |
Given that we dismissed |
Yeah, and nothing ever gelled around this idea. |
The question was initially asked by @kevin1e100:
The text was updated successfully, but these errors were encountered: