• Home
Name Date Size #Lines LOC

..--

src/main/java/03-May-2024-1,696597

.gitignoreD03-May-2024108 98

README.mdD03-May-20241.4 KiB4030

build.gradleD03-May-202486 53

README.md

1Stub Annotations
2
3The annotations in these packages are used to compile
4the stubs. They are mostly identical to the annotations
5in the support library, but
6
7(1) There are some annotations here which are not in
8   the support library, such as @RecentlyNullable and
9   @RecentlyNonNull. These are used *only* in the stubs
10   to automatically mark code as recently annotated
11   with null/non-null. We do *not* want these annotations
12   in the source code; the recent-ness is computed at
13   build time and injected into the stubs in place
14   of the normal null annotations.
15
16(2) There are some annotations in the support library
17   that do not apply here, such as @Keep,
18   @VisibleForTesting, etc.
19
20(3) Only class retention annotations are interesting for
21   the stubs; that means for example that we don't
22   include @IntDef and @StringDef.
23
24(4) We've tweaked the retention of some of the support
25   library annotations; some of them were accidentally
26   source retention, and here they are class retention.
27
28(5) We've tweaked the nullness annotations to include
29   TYPE_PARAMETER and TYPE_USE targets, and removed
30   package, local variable, annotation type, etc.
31
32(6) There are some other differences; for example, the
33   @RequiresPermission annotation here has an extra
34   "apis" field used for merged historical annotations
35   to express the applicable API range.
36
37Essentially, this is a curated list of exactly the
38set of annotations we allow injected into the stubs.
39
40