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

Commit b6bdb0f0 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Make ArrayMap.EMPTY immutable

This is a regression from KitKat.

Bug:19271657
Change-Id: I11b8e4dd50f6a8d2b15fef66b44aa2d72b1f0349
parent 81c80180
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -255,7 +255,10 @@ public final class ArrayMap<K, V> implements Map<K, V> {
    }

    private ArrayMap(boolean immutable) {
        mHashes = EmptyArray.INT;
        // If this is immutable, use the sentinal EMPTY_IMMUTABLE_INTS
        // instance instead of the usual EmptyArray.INT. The reference
        // is checked later to see if the array is allowed to grow.
        mHashes = immutable ? EMPTY_IMMUTABLE_INTS : EmptyArray.INT;
        mArray = EmptyArray.OBJECT;
        mSize = 0;
    }