Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6413795b authored by Tor Norbye's avatar Tor Norbye
Browse files

@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
parent a4cff858
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */
+2 −2
Original line number Diff line number Diff line
@@ -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 String element, represents a logical
@@ -43,7 +43,7 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
 *
 * @hide
 */
@Retention(CLASS)
@Retention(SOURCE)
@Target({ANNOTATION_TYPE})
public @interface StringDef {
    /** Defines the allowed constants for this element */