Replace enum with @IntDef (javatests)
@IntDef/@StringDef annotation are preferred way for declaring set of String/int values. 1. they need less space in APK than enum, see https://developer.android.com/topic/performance/reduce-apk-size#remove-enums 2. they give more control over allowed values than "static final" values Main goal of patch is writing "static final" values, enum and some classes in one common @IntDef/@StringDef form: 1. with @IntDef/@StringDef first, @Retention second and related @interface third 2. with values inside @interface 3. with NUM_ENTRIES declaring number of entries if necessary 4. with comment about numbering from 0 without gaps when necessary 5. with @Retention(RetentionPolicy.SOURCE) 6. without "static final" in the @interface Change-Id: I6aeb3571f6e72dd3599a4a6055189a227312d5c4 Reviewed-on: https://chromium-review.googlesource.com/1154527Reviewed-by:agrieve <agrieve@chromium.org> Reviewed-by:
Ted Choc <tedchoc@chromium.org> Reviewed-by:
Amirhossein Simjour <asimjour@chromium.org> Commit-Queue: Marcin Wiącek <marcin@mwiacek.com> Cr-Commit-Position: refs/heads/master@{#584198}
Showing
Please register or sign in to comment