diff options
| author | Tor Norbye <tnorbye@google.com> | 2017-05-12 15:57:28 -0700 |
|---|---|---|
| committer | Tor Norbye <tnorbye@google.com> | 2017-05-12 15:58:38 -0700 |
| commit | 6413795bbbbd94a9b821db9d62f409d2ae3e8c31 (patch) | |
| tree | 50771fc6a03725c03a366e61ff1e6bf718c58baf /core/java/android/annotation/IntDef.java | |
| parent | a4cff85897e22aacfd20041a29dd2ec2dbdb2788 (diff) | |
@IntDef and @StringDef must have source retention
They reference constant references, not constant values,
and this cannot be expressed in the .class file for
annotations; the data is instead extracted at build time
into external annotation data files.
Test: Manual
Change-Id: I06b366ba8815d1da40e6cbf906ebae09899c1b8e
Diffstat (limited to 'core/java/android/annotation/IntDef.java')
| -rw-r--r-- | core/java/android/annotation/IntDef.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/annotation/IntDef.java b/core/java/android/annotation/IntDef.java index dd712a6c7af4..3f9064e4dd73 100644 --- a/core/java/android/annotation/IntDef.java +++ b/core/java/android/annotation/IntDef.java @@ -19,7 +19,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.RetentionPolicy.CLASS; +import static java.lang.annotation.RetentionPolicy.SOURCE; /** * Denotes that the annotated element of integer type, represents @@ -48,7 +48,7 @@ import static java.lang.annotation.RetentionPolicy.CLASS; * * @hide */ -@Retention(CLASS) +@Retention(SOURCE) @Target({ANNOTATION_TYPE}) public @interface IntDef { /** Defines the constant prefix for this element */ |
