aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/core/src/main/java/com/google/protobuf/LongArrayList.java
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:32:48 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:33:05 -0700
commitd36c0c538a545fac5d9db6ba65c525246d4efa95 (patch)
tree3fd29af0f137dfaf5df892723e60600f674392b3 /java/core/src/main/java/com/google/protobuf/LongArrayList.java
parent4a0dd03e52e09332c8fd0f8f26a8e0ae9f911182 (diff)
Down-integrate from google3.
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/LongArrayList.java')
-rw-r--r--java/core/src/main/java/com/google/protobuf/LongArrayList.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/LongArrayList.java b/java/core/src/main/java/com/google/protobuf/LongArrayList.java
index 5a772e3a..fc146e23 100644
--- a/java/core/src/main/java/com/google/protobuf/LongArrayList.java
+++ b/java/core/src/main/java/com/google/protobuf/LongArrayList.java
@@ -30,8 +30,9 @@
package com.google.protobuf;
-import com.google.protobuf.Internal.LongList;
+import static com.google.protobuf.Internal.checkNotNull;
+import com.google.protobuf.Internal.LongList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
@@ -41,9 +42,8 @@ import java.util.RandomAccess;
*
* @author dweis@google.com (Daniel Weis)
*/
-final class LongArrayList
- extends AbstractProtobufList<Long>
- implements LongList, RandomAccess {
+final class LongArrayList extends AbstractProtobufList<Long>
+ implements LongList, RandomAccess, PrimitiveNonBoxingCollection {
private static final LongArrayList EMPTY_LIST = new LongArrayList();
static {
@@ -198,9 +198,7 @@ final class LongArrayList
public boolean addAll(Collection<? extends Long> collection) {
ensureIsMutable();
- if (collection == null) {
- throw new NullPointerException();
- }
+ checkNotNull(collection);
// We specialize when adding another LongArrayList to avoid boxing elements.
if (!(collection instanceof LongArrayList)) {