summaryrefslogtreecommitdiff
path: root/core/java/android/annotation/Nullable.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove annotations that have been relocatedChris Wailes2021-04-261-45/+0
| | | | | | | | | These annotations have been relocated to frameworks/libs/modules-utils. This CL removes the files and updates necessary build rules. Bug: 183133670 Test: m Change-Id: I834b9f5320e0b6fe8cb9feb7194c82085b805e07
* Remove nullablility annotations from module-libAnton Hansson2020-05-201-3/+0
| | | | | | | | | | | | | | | | | | They were added to workaround the problem of package-private versions being added to the stubs, which prevented use of the annotations from mainline modules. Having them in the API leads to a different problem -- this version of the nullability annotations have SOURCE retention. However in the stubs build we want to have CLASS retention, so that kotlin can make use of their presence. This is arguably a much cleaner fix, since having a source-retention annotation doesn't really make much sense. Bug: 157010342 Test: m Change-Id: Id78f00da5b6af2930224a82faa24cb8235362521
* Add @Nullable and @NonNull to module APIAnton Hansson2020-02-081-3/+6
| | | | | | | | | | | | | | | | | | These two annotations are already in the public/system stubs, but are re-written to be package private instead of public. This makes them inaccessible to libs building against these stubs. When setting sdk_version:<X>, the stubs of X will appear before any other libraries on the classpath. This also makes it impossible for modules to add Nullable annotations of their own when setting sdk_version. Exposing these annotations as public in the module stubs makes it possible for modules using these annotation to specify an sdk_version. Bug: 146758669 Test: m Test: downstream CLs using sdk_version:module_current Change-Id: I71fb766d02f833ed9a1b3a7dbfbc1c8118882b30
* Auto-generate docs based on annotations.Jeff Sharkey2017-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | We have a handful of annotations that we've been sprinkling across the platform APIs, such as @Nullable, @NonNull, @IntDef, etc. It would be really helpful to surface these contracts to developers through the SDK docs. This change allows annotations like those mentioned above to declare the following new javadoc fields: @memberDoc: docs to append to a field or method definition. @paramDoc: docs to append to a @param definition. @returnDoc: docs to append to a @return definition. This change also builds a docstring to describe the list of all constants listed in an @IntDef annotation. Sadly AnnotationDesc only passes along raw constant values, so we need the help of the new "prefix" annotation argument to help find the field names. Test: builds Bug: 37526420 Change-Id: I4cfc00dd904e5dfa945b406d546e36846b7c0c28
* Hide NonNull and Nullable.Tor Norbye2013-12-171-0/+2
| | | | | | | | These should not be used in app code; instead, we will add class-file retention versions of these to the support library. Change-Id: I13275bd28529f5da04d923688655be35c77dbb1c
* Add @NotNull, @Nullable, and @IntDef/@StringDef annotationsTor Norbye2013-08-151-0/+41
This changeset adds some annotations for recording whether a method return value or method parameter can be null (@Nullable), can never be null (@NotNull), or must be an integer enum or flag using one of the given constants. Change-Id: Ic932592ea3bac781c1df364447c57042461333c5