New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 919666 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature



Sign in to add a comment

Replace classes & enum with @IntDef/@StringDef

Project Member Reported by mar...@mwiacek.com, Jan 7

Issue description

@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 series 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


 
Description: Show this description
For the record: 

1) Wider discussion of this topic is on this discussion thread: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/intdef%7Csort:date/chromium-dev/DebQtiN5kMM/WuRsXrqBEgAJ

2) There are LOTS of changes that should have been listed under this bug.  One example here: https://chromium-review.googlesource.com/1137217


Cc: mdjones@chromium.org dtrainor@chromium.org dpranke@google.com changwan@chromium.org donnd@google.com
Other related changes: https://chromium-review.googlesource.com/q/owner:marcin%2540mwiacek.com+IntDef (which are already closed and their history cannot be updated in git tree)

donnd@, you added yourself to https://chromium-review.googlesource.com/c/chromium/src/+/1142764 and added mdjones@ to our discussion - 1142764 is formally perfect now and blocking it with "-1" because in the past something was not done with other CLs, looks potentially like potential biased action (I mean: it has totally different meaning that showing respect to my work in peaceful and constructive discussion)
https://chromium-review.googlesource.com/c/chromium/src/+/1142764 is probably one of last and I will just kindly ask for review.
> Other related changes...
Marcin, Thanks for working to backfill this bug!  I think this search might be better since it includes other people's changes that address this IntDef issue:
https://chromium-review.googlesource.com/q/%2540intdefhttps://chromium-review.googlesource.com/q/%2540intdef

BTW, I don't understand a lot of your comment in #3.  Are you saying that CL 1142764 is now ready for review?  Normally this is done in the CL itself by issuing a polite request there, e.g. "Please take another look, I think I have addressed all outstanding issues".
Cc: -donnd@google.com donnd@chromium.org

Sign in to add a comment