Index: base/android/java/src/org/chromium/base/UsedByReflection.java |
diff --git a/base/android/java/src/org/chromium/base/UsedByReflection.java b/base/android/java/src/org/chromium/base/UsedByReflection.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ebba44b97f2065f8c56e17d9c44601fb4449db3 |
--- /dev/null |
+++ b/base/android/java/src/org/chromium/base/UsedByReflection.java |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
mmenke
2014/03/07 17:02:39
Should again maintain the copyright years on these
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.base; |
+ |
+import java.lang.annotation.ElementType; |
+import java.lang.annotation.Target; |
+ |
+/** |
+ * Annotation used for marking methods and fields that are called by reflection. Useful for keeping |
+ * components that would otherwise be removed by Proguard. Use the value parameter to mention a file |
mmenke
2014/03/07 17:02:39
nit: Fix indent.
|
+ * that calls this method. |
+ * |
+ * Note that adding this annotation to a method is not enough to guarantee that |
+ * it is kept - either its class must be referenced elsewhere in the program, or |
+ * the class must be annotated with this as well. |
+ * |
+ * Usage example:<br /> |
+ * {@code |
+ * @UsedByReflection("PeopleListItemView.java") |
+ public PeopleListItemViewV11(Context context) { |
+ super(context); |
+ } |
+ } |
+ |
mmenke
2014/03/07 17:02:39
This comment is practically illegible.
mmenke
2014/03/07 20:47:28
To clarify: A bunch of lines are missing asterisk
Charles
2014/03/07 21:31:15
You can actually get rid of these annotations, chr
|
+ */ |
+@Target({ |
+ ElementType.METHOD, |
+ ElementType.FIELD, |
+ ElementType.TYPE, |
+ ElementType.CONSTRUCTOR}) |
+public @interface UsedByReflection { |
mef
2014/03/07 20:54:12
The |UsedByReflection| annotation has not been use
Charles
2014/03/07 21:31:15
These should probably be replaced by Chromium's pr
|
+ String value(); |
+} |