-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Explicitly indicate Nullability of arguments and return values #1105
Comments
The main problem here is that I really do not want to add a dependency to external annotations package. If JDK provided annotation with Java 8, I'd be happy to add those, but otherwise not. |
Unfortunately, as far as I know, I agree that external packages should not be added thoughtlessly. Alternatively, we could introduce our own annotations, although support by the |
If it was possible to have combination of not-RUNTIME retention and scope of For now I don't think I want to add these annotations here. |
I will share how I used The return value of the The A sample project is uploaded below (requires |
Currently
nullability
is not explicitly stated forJackson
.On the other hand, there are actually APIs that do not allow
null
input.Also, there are cases where inadvertent destructive changes can occur, as in the issue submitted below.
FasterXML/jackson-dataformat-xml#607
Personally, I think that Nullability annotations should be given to public interfaces to avoid such problems.
Jackson
is a huge project and we cannot fix everything at once, but I think we can proceed gradually.There are several possible annotations to use, but to minimize the impact, it is better to choose one whose
RetentionPolicy
is notRUNTIME
.The text was updated successfully, but these errors were encountered: