diff --git a/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java b/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java index cb9b62accebf3..e01cd6bc56e3f 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java @@ -145,6 +145,29 @@ private void add(int index, byte[] element) { modCount++; } + @Override + @CanIgnoreReturnValue + public boolean add(String element) { + ensureIsMutable(); + list.add(element); + modCount++; + return true; + } + + @Override + public void add(ByteString element) { + ensureIsMutable(); + list.add(element); + modCount++; + } + + @Override + public void add(byte[] element) { + ensureIsMutable(); + list.add(element); + modCount++; + } + @Override public boolean addAll(Collection c) { // The default implementation of AbstractCollection.addAll(Collection) @@ -197,20 +220,6 @@ public void clear() { modCount++; } - @Override - public void add(ByteString element) { - ensureIsMutable(); - list.add(element); - modCount++; - } - - @Override - public void add(byte[] element) { - ensureIsMutable(); - list.add(element); - modCount++; - } - @Override public Object getRaw(int index) { return list.get(index);