summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorPete Gillin <peteg@google.com>2018-06-06 17:39:02 +0100
committerPete Gillin <peteg@google.com>2018-06-06 17:46:25 +0100
commit91dcda6b3818d3c653e718fa4ba1e056fe4759bb (patch)
tree52de87e215616b5794f136783c8f4ca34206978a /annotations/generate_annotated_java_files.py
parentc96da1b25fb7b5e8d3ac414270e168a11e842a34 (diff)
Annotate java.lang.Object.
You can see the source files with the annotations in https://android-review.googlesource.com/c/platform/libcore/+/699804 (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. This annotates the return type of toString() as @NonNull. This seems justified on the grounds that (a) the javadoc says that it "returns a string", (b) the vast majority of implementations don't return null, and (c) the vast majority of callers don't do null checks on the result. The risk is that users could get unexpected NPEs when using Objects where toString() does return null. This seems better than the alternative, which is to force all users to do null checks on the result of toString(). Test: make docs Bug: 64930165 Change-Id: Id71f15fe0c58d30866249511a541da33d8958aa4
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions