aboutsummaryrefslogtreecommitdiff
path: root/java/src/main/java/com/google/protobuf/LongArrayList.java
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2015-12-11 17:09:20 -0800
committerFeng Xiao <xfxyjwf@gmail.com>2015-12-11 17:10:28 -0800
commite841bac4fcf47f809e089a70d5f84ac37b3883df (patch)
treed25dc5fc814db182c04c5f276ff1a609c5965a5a /java/src/main/java/com/google/protobuf/LongArrayList.java
parent99a6a95c751a28a3cc33dd2384959179f83f682c (diff)
downloadprotobuf-e841bac4fcf47f809e089a70d5f84ac37b3883df.tar.gz
protobuf-e841bac4fcf47f809e089a70d5f84ac37b3883df.tar.bz2
protobuf-e841bac4fcf47f809e089a70d5f84ac37b3883df.zip
Down-integrate from internal code base.
Diffstat (limited to 'java/src/main/java/com/google/protobuf/LongArrayList.java')
-rw-r--r--java/src/main/java/com/google/protobuf/LongArrayList.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/java/src/main/java/com/google/protobuf/LongArrayList.java b/java/src/main/java/com/google/protobuf/LongArrayList.java
index 298617ff..ebe62029 100644
--- a/java/src/main/java/com/google/protobuf/LongArrayList.java
+++ b/java/src/main/java/com/google/protobuf/LongArrayList.java
@@ -67,10 +67,17 @@ final class LongArrayList extends AbstractProtobufList<Long> implements LongList
private int size;
/**
- * Constructs a new mutable {@code LongArrayList}.
+ * Constructs a new mutable {@code LongArrayList} with default capacity.
*/
LongArrayList() {
- array = new long[DEFAULT_CAPACITY];
+ this(DEFAULT_CAPACITY);
+ }
+
+ /**
+ * Constructs a new mutable {@code LongArrayList} with the provided capacity.
+ */
+ LongArrayList(int capacity) {
+ array = new long[capacity];
size = 0;
}