diff options
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/IntArrayList.java')
-rw-r--r-- | java/core/src/main/java/com/google/protobuf/IntArrayList.java | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/IntArrayList.java b/java/core/src/main/java/com/google/protobuf/IntArrayList.java index 4993eea7..c9b12c42 100644 --- a/java/core/src/main/java/com/google/protobuf/IntArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/IntArrayList.java @@ -42,11 +42,11 @@ import java.util.RandomAccess; * * @author dweis@google.com (Daniel Weis) */ -final class IntArrayList - extends AbstractProtobufList<Integer> +final class IntArrayList extends AbstractProtobufList<Integer> implements IntList, RandomAccess, PrimitiveNonBoxingCollection { private static final IntArrayList EMPTY_LIST = new IntArrayList(); + static { EMPTY_LIST.makeImmutable(); } @@ -55,9 +55,7 @@ final class IntArrayList return EMPTY_LIST; } - /** - * The backing store for the list. - */ + /** The backing store for the list. */ private int[] array; /** @@ -66,16 +64,13 @@ final class IntArrayList */ private int size; - /** - * Constructs a new mutable {@code IntArrayList} with default capacity. - */ + /** Constructs a new mutable {@code IntArrayList} with default capacity. */ IntArrayList() { this(new int[DEFAULT_CAPACITY], 0); } /** - * Constructs a new mutable {@code IntArrayList} - * containing the same elements as {@code other}. + * Constructs a new mutable {@code IntArrayList} containing the same elements as {@code other}. */ private IntArrayList(int[] other, int size) { array = other; @@ -169,17 +164,13 @@ final class IntArrayList addInt(index, element); } - /** - * Like {@link #add(Integer)} but more efficient in that it doesn't box the element. - */ + /** Like {@link #add(Integer)} but more efficient in that it doesn't box the element. */ @Override public void addInt(int element) { addInt(size, element); } - /** - * Like {@link #add(int, Integer)} but more efficient in that it doesn't box the element. - */ + /** Like {@link #add(int, Integer)} but more efficient in that it doesn't box the element. */ private void addInt(int index, int element) { ensureIsMutable(); if (index < 0 || index > size) { |