Add nullability annotations to j.t.DateFormat and NumberFormat.

There is one non-obvious choice here. DateFormat.setCalendar(null)
does not fail, but it puts the object into a useless state (unless, I
suppose, this is a subclass which overrides all the methods that read
the field). DateFormat.getCalendar() does return null if it follows
setCalendar(null). The best choice seems to be to annotate the
parameter of setCalendar(Calendar) as @NonNull, since it is helpful to
warn the user if they try to set to null; and to annotate the return
type of getCalendar() as @NonNull also, since it would be unhelpful to
tell users to check the value for null just because of this edge case.

Bug: 64930165
Test: treehugger
Change-Id: I35b390c9e120ac3c507fbe9bbd63891175525b95
2 files changed