Dear JSpecify team,
Recently have I started to implement JSpecify within my project.
During this process have I come to a situation that raised a question I couldn’t answer by reading the Javadoc of the annotation or reading your FAQ page.
This question is, how NullMarked or NullUnmarked classes, interfaces, etc. are handled/understood, if said class, interface, etc. is implemented/extended into another, which also is marked as NullMarked/NullUnmarked.
More specifically, imagine the following situation:
- Interface MyInterfaceA is containing «String getSomeString()», «Integer getSomeInteger()» and «Boolean getSomeBoolean()». It is marked with NullMarked on the class level.
- Interface MyInterfaceB<T> is extending MyInterfaceA and adds «T getGeneric()». It is annotated with NullUnmarked also on the class level.
Would in such a situation the methods of MyInterfaceA still be considered as NonNull through its NullMarked annotation, or would the NullUnmarked annotation take priority here and force them to be considered Nullable?
It’s something I believe should be answered somewhere within your documentation. If already the case should it be mentioned more prominently as I haven’t seen nor found it anywhere during my search.
I hope for a quick and clear reply and wish you a nice day.
Sincerely,
Andreas Schmidt