-
Notifications
You must be signed in to change notification settings - Fork 352
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
Marking some fields in the returned object of a method NonNull and others Nullable? #3296
Comments
This is a good question. The solution to your problem is qualifier polymorphism over classes. Currently, the Checker Framework supports Java generics, and also qualifier polymorphims over methods. Pull request #2883 implements qualifier polymorphims for classes. We are hoping to complete that feature soon -- in the next release or two -- but this depends on how much time everyone has to work on it. |
Thanks very much! Hoping to see that! |
The limited form of class qualifier parameters in #2883 will not help in this situation - and it won't help with the Nullness Checker in general. The main qualifier of a type is reused for the qualifier parameter - but if the main qualifier is In the @EnsuresNonNullIf(result=true, expression="createAt")
boolean isFullArticle() ... We currently don't have a mechanism to specify as post-condition of |
Thanks very much! |
The |
Er sorry I do not quite get it... How do I write a "trivial type-checker", do you mean extending the existing Checker Framework? |
Yes. The process is explained at https://checkerframework.org/manual/#creating-a-checker . |
Thanks very much! |
Hi! Thanks for the interesting library! A very simple question: I have a class (actually, a model, if you are interested) like -
And I have a class returning it:
Question: How can I annotate that properly?
Thanks very much!
The text was updated successfully, but these errors were encountered: