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

Commit 55c2256e authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Start using Ravenwood annotations in source tree.

These inline annotations make maintenance commitments easier for
code owners to reason about.

Bug: 292141694
Test: atest-dev CtsUtilTestCasesRavenwood CtsUtilTestCases
Change-Id: Ia3479c7fd66123e2cc759c661fc551967ecdec08
parent 9b790b42
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import java.util.function.IntFunction;
/**
 * Static utility methods for arrays that aren't already included in {@link java.util.Arrays}.
 */
@android.ravenwood.annotation.RavenwoodKeepWholeClass
public class ArrayUtils {
    private static final int CACHE_SIZE = 73;
    private static Object[] sCache = new Object[CACHE_SIZE];
@@ -48,35 +49,43 @@ public class ArrayUtils {

    private ArrayUtils() { /* cannot be instantiated */ }

    @android.ravenwood.annotation.RavenwoodReplace
    public static byte[] newUnpaddedByteArray(int minLen) {
        return (byte[])VMRuntime.getRuntime().newUnpaddedArray(byte.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    public static char[] newUnpaddedCharArray(int minLen) {
        return (char[])VMRuntime.getRuntime().newUnpaddedArray(char.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public static int[] newUnpaddedIntArray(int minLen) {
        return (int[])VMRuntime.getRuntime().newUnpaddedArray(int.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    public static boolean[] newUnpaddedBooleanArray(int minLen) {
        return (boolean[])VMRuntime.getRuntime().newUnpaddedArray(boolean.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    public static long[] newUnpaddedLongArray(int minLen) {
        return (long[])VMRuntime.getRuntime().newUnpaddedArray(long.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    public static float[] newUnpaddedFloatArray(int minLen) {
        return (float[])VMRuntime.getRuntime().newUnpaddedArray(float.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    public static Object[] newUnpaddedObjectArray(int minLen) {
        return (Object[])VMRuntime.getRuntime().newUnpaddedArray(Object.class, minLen);
    }

    @android.ravenwood.annotation.RavenwoodReplace
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @SuppressWarnings("unchecked")
    public static <T> T[] newUnpaddedArray(Class<T> clazz, int minLen) {
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.ravenwood.annotations;
package android.ravenwood.annotation;

import static java.lang.annotation.ElementType.TYPE;

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.ravenwood.annotations;
package android.ravenwood.annotation;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.ravenwood.annotations;
package android.ravenwood.annotation;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
@@ -35,5 +35,5 @@ import java.lang.annotation.Target;
 */
@Target({TYPE, FIELD, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
public @interface RavenwoodWholeClassKeep {
public @interface RavenwoodKeepWholeClass {
}
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.ravenwood.annotations;
package android.ravenwood.annotation;

import static java.lang.annotation.ElementType.TYPE;

Loading