Add nullability annotations to some j.u.Locale and Calendar.
Notes:
- The Calendar constructor does actually accept a null Locale
argument. But there's a TODO saying that it's for backwards
compatibility only and should be changed to check and throw in
future. This change annotates it as @NonNull because otherwise
that future change would be impossible.
- It may not be entirely guaranteed that the keys and values of
the Map returned by Calendar.getDisplayNames are not null, but
it seems to be the intention, based on the javadoc and all the
known code paths.
- Locale.Builder.setLanguageTag's javadoc claims that it accepts
a null argument, but the implementation does not. (There is an
open bug about this.) This change annotates it as @NonNull to
reflect the real behaviour.
- Locale.parse and Locale.mapEquivalents don't actually throw if
their Map arguements contain nulls in all cases, but it seems
to be the intention that they shouldn't, based on javadoc, so
this change annotates them all as @NonNull.
Bug: 64930165
Test: treehugger
Change-Id: I61bd750f0df57774e68ce124e739136119a76a86
2 files changed