| Index: third_party/protobuf/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| diff --git a/third_party/protobuf/java/src/main/java/com/google/protobuf/UnknownFieldSet.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| similarity index 95%
|
| rename from third_party/protobuf/java/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| rename to third_party/protobuf/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| index 7cd2250e132ee88cc4e340b7a48cd834c7a7f2ae..c906420da1a6ea05bbd4f36b4880f84a2eec00e7 100644
|
| --- a/third_party/protobuf/java/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| +++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java
|
| @@ -76,6 +76,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| public static UnknownFieldSet getDefaultInstance() {
|
| return defaultInstance;
|
| }
|
| + @Override
|
| public UnknownFieldSet getDefaultInstanceForType() {
|
| return defaultInstance;
|
| }
|
| @@ -126,6 +127,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| }
|
|
|
| /** Serializes the set and writes it to {@code output}. */
|
| + @Override
|
| public void writeTo(final CodedOutputStream output) throws IOException {
|
| for (final Map.Entry<Integer, Field> entry : fields.entrySet()) {
|
| entry.getValue().writeTo(entry.getKey(), output);
|
| @@ -146,6 +148,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * Serializes the message to a {@code ByteString} and returns it. This is
|
| * just a trivial wrapper around {@link #writeTo(CodedOutputStream)}.
|
| */
|
| + @Override
|
| public ByteString toByteString() {
|
| try {
|
| final ByteString.CodedBuilder out =
|
| @@ -163,6 +166,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * Serializes the message to a {@code byte} array and returns it. This is
|
| * just a trivial wrapper around {@link #writeTo(CodedOutputStream)}.
|
| */
|
| + @Override
|
| public byte[] toByteArray() {
|
| try {
|
| final byte[] result = new byte[getSerializedSize()];
|
| @@ -181,12 +185,14 @@ public final class UnknownFieldSet implements MessageLite {
|
| * Serializes the message and writes it to {@code output}. This is just a
|
| * trivial wrapper around {@link #writeTo(CodedOutputStream)}.
|
| */
|
| + @Override
|
| public void writeTo(final OutputStream output) throws IOException {
|
| final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
|
| writeTo(codedOutput);
|
| codedOutput.flush();
|
| }
|
|
|
| + @Override
|
| public void writeDelimitedTo(OutputStream output) throws IOException {
|
| final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
|
| codedOutput.writeRawVarint32(getSerializedSize());
|
| @@ -195,6 +201,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| }
|
|
|
| /** Get the number of bytes required to encode this set. */
|
| + @Override
|
| public int getSerializedSize() {
|
| int result = 0;
|
| for (final Map.Entry<Integer, Field> entry : fields.entrySet()) {
|
| @@ -228,6 +235,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| return result;
|
| }
|
|
|
| + @Override
|
| public boolean isInitialized() {
|
| // UnknownFieldSets do not have required fields, so they are always
|
| // initialized.
|
| @@ -258,10 +266,12 @@ public final class UnknownFieldSet implements MessageLite {
|
| return newBuilder().mergeFrom(input).build();
|
| }
|
|
|
| + @Override
|
| public Builder newBuilderForType() {
|
| return newBuilder();
|
| }
|
|
|
| + @Override
|
| public Builder toBuilder() {
|
| return newBuilder().mergeFrom(this);
|
| }
|
| @@ -329,6 +339,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * in undefined behavior and can cause a {@code NullPointerException} to be
|
| * thrown.
|
| */
|
| + @Override
|
| public UnknownFieldSet build() {
|
| getFieldBuilder(0); // Force lastField to be built.
|
| final UnknownFieldSet result;
|
| @@ -341,6 +352,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| return result;
|
| }
|
|
|
| + @Override
|
| public UnknownFieldSet buildPartial() {
|
| // No required fields, so this is the same as build().
|
| return build();
|
| @@ -353,6 +365,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| new UnknownFieldSet(fields));
|
| }
|
|
|
| + @Override
|
| public UnknownFieldSet getDefaultInstanceForType() {
|
| return UnknownFieldSet.getDefaultInstance();
|
| }
|
| @@ -364,6 +377,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| }
|
|
|
| /** Reset the builder to an empty set. */
|
| + @Override
|
| public Builder clear() {
|
| reinitialize();
|
| return this;
|
| @@ -487,6 +501,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * Parse an entire message from {@code input} and merge its fields into
|
| * this set.
|
| */
|
| + @Override
|
| public Builder mergeFrom(final CodedInputStream input) throws IOException {
|
| while (true) {
|
| final int tag = input.readTag();
|
| @@ -536,8 +551,8 @@ public final class UnknownFieldSet implements MessageLite {
|
| * set being built. This is just a small wrapper around
|
| * {@link #mergeFrom(CodedInputStream)}.
|
| */
|
| - public Builder mergeFrom(final ByteString data)
|
| - throws InvalidProtocolBufferException {
|
| + @Override
|
| + public Builder mergeFrom(final ByteString data) throws InvalidProtocolBufferException {
|
| try {
|
| final CodedInputStream input = data.newCodedInput();
|
| mergeFrom(input);
|
| @@ -557,8 +572,8 @@ public final class UnknownFieldSet implements MessageLite {
|
| * set being built. This is just a small wrapper around
|
| * {@link #mergeFrom(CodedInputStream)}.
|
| */
|
| - public Builder mergeFrom(final byte[] data)
|
| - throws InvalidProtocolBufferException {
|
| + @Override
|
| + public Builder mergeFrom(final byte[] data) throws InvalidProtocolBufferException {
|
| try {
|
| final CodedInputStream input = CodedInputStream.newInstance(data);
|
| mergeFrom(input);
|
| @@ -578,6 +593,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * set being built. This is just a small wrapper around
|
| * {@link #mergeFrom(CodedInputStream)}.
|
| */
|
| + @Override
|
| public Builder mergeFrom(final InputStream input) throws IOException {
|
| final CodedInputStream codedInput = CodedInputStream.newInstance(input);
|
| mergeFrom(codedInput);
|
| @@ -585,8 +601,8 @@ public final class UnknownFieldSet implements MessageLite {
|
| return this;
|
| }
|
|
|
| - public boolean mergeDelimitedFrom(InputStream input)
|
| - throws IOException {
|
| + @Override
|
| + public boolean mergeDelimitedFrom(InputStream input) throws IOException {
|
| final int firstByte = input.read();
|
| if (firstByte == -1) {
|
| return false;
|
| @@ -597,30 +613,29 @@ public final class UnknownFieldSet implements MessageLite {
|
| return true;
|
| }
|
|
|
| - public boolean mergeDelimitedFrom(
|
| - InputStream input,
|
| - ExtensionRegistryLite extensionRegistry) throws IOException {
|
| + @Override
|
| + public boolean mergeDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
|
| + throws IOException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeDelimitedFrom(input);
|
| }
|
|
|
| - public Builder mergeFrom(
|
| - CodedInputStream input,
|
| - ExtensionRegistryLite extensionRegistry) throws IOException {
|
| + @Override
|
| + public Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
|
| + throws IOException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeFrom(input);
|
| }
|
|
|
| - public Builder mergeFrom(
|
| - ByteString data,
|
| - ExtensionRegistryLite extensionRegistry)
|
| + @Override
|
| + public Builder mergeFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
|
| throws InvalidProtocolBufferException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeFrom(data);
|
| }
|
|
|
| - public Builder mergeFrom(byte[] data, int off, int len)
|
| - throws InvalidProtocolBufferException {
|
| + @Override
|
| + public Builder mergeFrom(byte[] data, int off, int len) throws InvalidProtocolBufferException {
|
| try {
|
| final CodedInputStream input =
|
| CodedInputStream.newInstance(data, off, len);
|
| @@ -636,29 +651,37 @@ public final class UnknownFieldSet implements MessageLite {
|
| }
|
| }
|
|
|
| - public Builder mergeFrom(
|
| - byte[] data,
|
| - ExtensionRegistryLite extensionRegistry)
|
| + @Override
|
| + public Builder mergeFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
|
| throws InvalidProtocolBufferException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeFrom(data);
|
| }
|
|
|
| - public Builder mergeFrom(
|
| - byte[] data, int off, int len,
|
| - ExtensionRegistryLite extensionRegistry)
|
| + @Override
|
| + public Builder mergeFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry)
|
| throws InvalidProtocolBufferException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeFrom(data, off, len);
|
| }
|
|
|
| - public Builder mergeFrom(
|
| - InputStream input,
|
| - ExtensionRegistryLite extensionRegistry) throws IOException {
|
| + @Override
|
| + public Builder mergeFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
|
| + throws IOException {
|
| // UnknownFieldSet has no extensions.
|
| return mergeFrom(input);
|
| }
|
|
|
| + @Override
|
| + public Builder mergeFrom(MessageLite m) {
|
| + if (m instanceof UnknownFieldSet) {
|
| + return mergeFrom((UnknownFieldSet) m);
|
| + }
|
| + throw new IllegalArgumentException(
|
| + "mergeFrom(MessageLite) can only merge messages of the same type.");
|
| + }
|
| +
|
| + @Override
|
| public boolean isInitialized() {
|
| // UnknownFieldSets do not have required fields, so they are always
|
| // initialized.
|
| @@ -987,6 +1010,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| * Parser to implement MessageLite interface.
|
| */
|
| public static final class Parser extends AbstractParser<UnknownFieldSet> {
|
| + @Override
|
| public UnknownFieldSet parsePartialFrom(
|
| CodedInputStream input, ExtensionRegistryLite extensionRegistry)
|
| throws InvalidProtocolBufferException {
|
| @@ -1004,6 +1028,7 @@ public final class UnknownFieldSet implements MessageLite {
|
| }
|
|
|
| private static final Parser PARSER = new Parser();
|
| + @Override
|
| public final Parser getParserForType() {
|
| return PARSER;
|
| }
|
|
|