diff options
author | Pete Gillin <peteg@google.com> | 2018-06-07 17:08:44 +0100 |
---|---|---|
committer | Pete Gillin <peteg@google.com> | 2018-06-07 19:21:46 +0100 |
commit | c85c81cc10e3d98dd0c42034127384ad069b31c7 (patch) | |
tree | d0d5b9edd09372c45dbc25c4a216456e4e36c678 /include/ScopedJavaUnicodeString.h | |
parent | 0a320a531187ae21ca73b16918c7572eb44cc6d1 (diff) |
Annotate java.io.PrintWriter.
You can see the source files with the annotations in
https://android-review.googlesource.com/c/platform/libcore/+/701254
(which obviously is not intended for submission). The .jaif changes
here were copy-and-pasted from the results of running the
extract-annotations tool on those sources.
Most of this is straightforward.
The constructors mostly don't actually throw NPE if you pass a null to
them, but you do get a useless PrintWriter back, so it seems sensible
to annotate those as @NonNull.
You can pass a null array to the printf-style methods with something
like this: printf("message", (Object[]) null). The javadoc doesn't
specify what happens if you try. The implementation seems to accept
it. However, without a guarantee, it seems safer to mark that argument
as @NonNull. It's a very odd thing to write, anyway. The contents of
the array/varargs are @Nullable since it is legal to write
e.g. printf("this is %s", null) which passes a non-null array
containing a null object.
Test: make docs
Bug: 64930165
(cherry picked from commit df047a2dcf17fc2841d0f8aaed3094cf6e13940c)
Change-Id: Ia23c9176c386ec8630d642c6fb48bd5d03b652c8
Merged-In: I2d2788714a2df24b253490c83dd0f8b4316feef9
Diffstat (limited to 'include/ScopedJavaUnicodeString.h')
0 files changed, 0 insertions, 0 deletions