summaryrefslogtreecommitdiff
path: root/ojluni/annotations/hiddenapi/java/io/ObjectStreamClass.java
diff options
context:
space:
mode:
authorPete Gillin <peteg@google.com>2018-10-24 19:03:52 +0100
committerPete Gillin <peteg@google.com>2018-10-24 19:03:52 +0100
commit3bc6ca4567800c162dd4977dc42ae8e55876911d (patch)
tree06186389bfd769357b12e0bc0097c97a275d1609 /ojluni/annotations/hiddenapi/java/io/ObjectStreamClass.java
parent681dd03fac3b95565018d4bd8141521d216965a5 (diff)
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
Diffstat (limited to 'ojluni/annotations/hiddenapi/java/io/ObjectStreamClass.java')
0 files changed, 0 insertions, 0 deletions