From 72bef10798882e7a28e5ba5dc592b50c0c5ccc78 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Tue, 8 Nov 2022 07:57:02 -0800 Subject: [PATCH] Upgrade from [6-year-old](https://repo1.maven.org/maven2/com/google/protobuf/protobuf-lite/3.0.1/) `protobuf-lite` to its modern equivalent, `protobuf-javalite`. This change should mostly not be user-visible, since we [declare this dependency as `optional`](https://github.com/google/truth/blob/1de76958abc8f3dbfad07d142bd290dc53d7427a/extensions/liteproto/pom.xml#L43). The new version doesn't support the `optimize_for = LITE_RUNTIME` option in `.proto` files, presumably on the theory that you should be able to compile the same protobuf for both the "lite" and "speed" runtimes. Unfortunately, xolstice/protobuf-maven-plugin does not provide a way to pass the `lite` option to the protobuf compiler. (That option was added in https://github.com/xolstice/protobuf-maven-plugin/commit/3ae165e5f6b33f8a6221ece11cc79a7df5eeb8df, but that is not yet part of [a release](https://github.com/xolstice/protobuf-maven-plugin/tags). And the project doesn't appear very active lately.) So we can't generate the Java protobuf classes with that plugin. Maybe there's another plugin we could use, if only one that runs an arbitrary executable? But for now, I'm taking another approach: I'm submitting the generated sources. To generate them, I ran `mvn clean install -X -e`, found the location of the protobuf executable and arguments in the output, and ran it with `--java_out=lite:/the/path/from/the/output`. Then I tweaked the Maven setup to build those sources instead of generating and building the protobuf ones. Yuck. This could cause someone some frustration down the line when it comes time to make a change to the test protos. But given that we haven't had to change those protos yet in their 6+ years of existence, I'm hoping for the best. Another alternative for us to consider is to just not run these specific tests in our open-source build. RELNOTES=n/a PiperOrigin-RevId: 486951466 --- extensions/liteproto/pom.xml | 29 +- .../proto/OtherTestMessageLite2.java | 256 +++++++ .../proto/OtherTestMessageLite2OrBuilder.java | 20 + .../proto/OtherTestMessageLite3.java | 238 +++++++ .../proto/OtherTestMessageLite3OrBuilder.java | 15 + .../extensions/proto/TestMessageLite2.java | 665 ++++++++++++++++++ .../proto/TestMessageLite2OrBuilder.java | 31 + .../proto/TestMessageLite2OuterClass.java | 16 + .../TestMessageLite2WithRequiredFields.java | 372 ++++++++++ ...ssageLite2WithRequiredFieldsOrBuilder.java | 37 + .../extensions/proto/TestMessageLite3.java | 625 ++++++++++++++++ .../proto/TestMessageLite3OrBuilder.java | 26 + .../proto/TestMessageLite3OuterClass.java | 16 + .../src/test/proto/test_message_lite2.proto | 2 - .../src/test/proto/test_message_lite3.proto | 2 - pom.xml | 12 +- 16 files changed, 2350 insertions(+), 12 deletions(-) create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2OrBuilder.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3OrBuilder.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OrBuilder.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OuterClass.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFields.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFieldsOrBuilder.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OrBuilder.java create mode 100644 extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OuterClass.java diff --git a/extensions/liteproto/pom.xml b/extensions/liteproto/pom.xml index 82bdc46d8..74d0f7f7f 100644 --- a/extensions/liteproto/pom.xml +++ b/extensions/liteproto/pom.xml @@ -38,8 +38,8 @@ com.google.protobuf - protobuf-lite - + protobuf-javalite + true @@ -60,11 +60,13 @@ org.xolstice.maven.plugins protobuf-maven-plugin - com.google.protobuf:protoc:${protobuf-lite.protoc.version}:exe:${os.detected.classifier} + com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} test_message_lite2.proto test_message_lite3.proto + + true @@ -73,6 +75,27 @@ test-compile + + lite + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + copy-proto-generated-code + generate-test-sources + + add-test-source + + + + pre-generated-test-sources + + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2.java new file mode 100644 index 000000000..777c1ed3f --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2.java @@ -0,0 +1,256 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +/** + * Protobuf type {@code com.google.common.truth.extensions.proto.OtherTestMessageLite2} + */ +public final class OtherTestMessageLite2 extends + com.google.protobuf.GeneratedMessageLite< + OtherTestMessageLite2, OtherTestMessageLite2.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.OtherTestMessageLite2) + OtherTestMessageLite2OrBuilder { + private OtherTestMessageLite2() { + } + private int bitField0_; + public static final int OPTIONAL_INT_FIELD_NUMBER = 1; + private int optionalInt_; + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + @java.lang.Override + public boolean hasOptionalInt() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return optionalInt_; + } + /** + * optional int32 optional_int = 1; + * @param value The optionalInt to set. + */ + private void setOptionalInt(int value) { + bitField0_ |= 0x00000001; + optionalInt_ = value; + } + /** + * optional int32 optional_int = 1; + */ + private void clearOptionalInt() { + bitField0_ = (bitField0_ & ~0x00000001); + optionalInt_ = 0; + } + + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.OtherTestMessageLite2 prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.OtherTestMessageLite2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.OtherTestMessageLite2, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.OtherTestMessageLite2) + com.google.common.truth.extensions.proto.OtherTestMessageLite2OrBuilder { + // Construct using com.google.common.truth.extensions.proto.OtherTestMessageLite2.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + @java.lang.Override + public boolean hasOptionalInt() { + return instance.hasOptionalInt(); + } + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return instance.getOptionalInt(); + } + /** + * optional int32 optional_int = 1; + * @param value The optionalInt to set. + * @return This builder for chaining. + */ + public Builder setOptionalInt(int value) { + copyOnWrite(); + instance.setOptionalInt(value); + return this; + } + /** + * optional int32 optional_int = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalInt() { + copyOnWrite(); + instance.clearOptionalInt(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.OtherTestMessageLite2) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.OtherTestMessageLite2(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", + "optionalInt_", + }; + java.lang.String info = + "\u0001\u0001\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u1004\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.OtherTestMessageLite2.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.OtherTestMessageLite2) + private static final com.google.common.truth.extensions.proto.OtherTestMessageLite2 DEFAULT_INSTANCE; + static { + OtherTestMessageLite2 defaultInstance = new OtherTestMessageLite2(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OtherTestMessageLite2.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.OtherTestMessageLite2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2OrBuilder.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2OrBuilder.java new file mode 100644 index 000000000..58f9b9f6f --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite2OrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +public interface OtherTestMessageLite2OrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.OtherTestMessageLite2) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + boolean hasOptionalInt(); + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + int getOptionalInt(); +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3.java new file mode 100644 index 000000000..37e0b3f28 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3.java @@ -0,0 +1,238 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite3.proto + +package com.google.common.truth.extensions.proto; + +/** + * Protobuf type {@code com.google.common.truth.extensions.proto.OtherTestMessageLite3} + */ +public final class OtherTestMessageLite3 extends + com.google.protobuf.GeneratedMessageLite< + OtherTestMessageLite3, OtherTestMessageLite3.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.OtherTestMessageLite3) + OtherTestMessageLite3OrBuilder { + private OtherTestMessageLite3() { + } + public static final int OPTIONAL_INT_FIELD_NUMBER = 1; + private int optionalInt_; + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return optionalInt_; + } + /** + * int32 optional_int = 1; + * @param value The optionalInt to set. + */ + private void setOptionalInt(int value) { + + optionalInt_ = value; + } + /** + * int32 optional_int = 1; + */ + private void clearOptionalInt() { + + optionalInt_ = 0; + } + + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.OtherTestMessageLite3 prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.OtherTestMessageLite3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.OtherTestMessageLite3, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.OtherTestMessageLite3) + com.google.common.truth.extensions.proto.OtherTestMessageLite3OrBuilder { + // Construct using com.google.common.truth.extensions.proto.OtherTestMessageLite3.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return instance.getOptionalInt(); + } + /** + * int32 optional_int = 1; + * @param value The optionalInt to set. + * @return This builder for chaining. + */ + public Builder setOptionalInt(int value) { + copyOnWrite(); + instance.setOptionalInt(value); + return this; + } + /** + * int32 optional_int = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalInt() { + copyOnWrite(); + instance.clearOptionalInt(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.OtherTestMessageLite3) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.OtherTestMessageLite3(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "optionalInt_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0004"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.OtherTestMessageLite3.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.OtherTestMessageLite3) + private static final com.google.common.truth.extensions.proto.OtherTestMessageLite3 DEFAULT_INSTANCE; + static { + OtherTestMessageLite3 defaultInstance = new OtherTestMessageLite3(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OtherTestMessageLite3.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.OtherTestMessageLite3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3OrBuilder.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3OrBuilder.java new file mode 100644 index 000000000..e7849e450 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/OtherTestMessageLite3OrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite3.proto + +package com.google.common.truth.extensions.proto; + +public interface OtherTestMessageLite3OrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.OtherTestMessageLite3) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + int getOptionalInt(); +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2.java new file mode 100644 index 000000000..532cd1413 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2.java @@ -0,0 +1,665 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +/** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2} + */ +public final class TestMessageLite2 extends + com.google.protobuf.GeneratedMessageLite< + TestMessageLite2, TestMessageLite2.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.TestMessageLite2) + TestMessageLite2OrBuilder { + private TestMessageLite2() { + } + public interface SubMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional string optional_string = 1; + * @return Whether the optionalString field is set. + */ + boolean hasOptionalString(); + /** + * optional string optional_string = 1; + * @return The optionalString. + */ + java.lang.String getOptionalString(); + /** + * optional string optional_string = 1; + * @return The bytes for optionalString. + */ + com.google.protobuf.ByteString + getOptionalStringBytes(); + } + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage} + */ + public static final class SubMessage extends + com.google.protobuf.GeneratedMessageLite< + SubMessage, SubMessage.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage) + SubMessageOrBuilder { + private SubMessage() { + optionalString_ = ""; + } + private int bitField0_; + public static final int OPTIONAL_STRING_FIELD_NUMBER = 1; + private java.lang.String optionalString_; + /** + * optional string optional_string = 1; + * @return Whether the optionalString field is set. + */ + @java.lang.Override + public boolean hasOptionalString() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string optional_string = 1; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return optionalString_; + } + /** + * optional string optional_string = 1; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(optionalString_); + } + /** + * optional string optional_string = 1; + * @param value The optionalString to set. + */ + private void setOptionalString( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + bitField0_ |= 0x00000001; + optionalString_ = value; + } + /** + * optional string optional_string = 1; + */ + private void clearOptionalString() { + bitField0_ = (bitField0_ & ~0x00000001); + optionalString_ = getDefaultInstance().getOptionalString(); + } + /** + * optional string optional_string = 1; + * @param value The bytes for optionalString to set. + */ + private void setOptionalStringBytes( + com.google.protobuf.ByteString value) { + optionalString_ = value.toStringUtf8(); + bitField0_ |= 0x00000001; + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage) + com.google.common.truth.extensions.proto.TestMessageLite2.SubMessageOrBuilder { + // Construct using com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * optional string optional_string = 1; + * @return Whether the optionalString field is set. + */ + @java.lang.Override + public boolean hasOptionalString() { + return instance.hasOptionalString(); + } + /** + * optional string optional_string = 1; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return instance.getOptionalString(); + } + /** + * optional string optional_string = 1; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return instance.getOptionalStringBytes(); + } + /** + * optional string optional_string = 1; + * @param value The optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalString( + java.lang.String value) { + copyOnWrite(); + instance.setOptionalString(value); + return this; + } + /** + * optional string optional_string = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalString() { + copyOnWrite(); + instance.clearOptionalString(); + return this; + } + /** + * optional string optional_string = 1; + * @param value The bytes for optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalStringBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOptionalStringBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", + "optionalString_", + }; + java.lang.String info = + "\u0001\u0001\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u1008\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage) + private static final com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage DEFAULT_INSTANCE; + static { + SubMessage defaultInstance = new SubMessage(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SubMessage.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + private int bitField0_; + public static final int OPTIONAL_INT_FIELD_NUMBER = 1; + private int optionalInt_; + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + @java.lang.Override + public boolean hasOptionalInt() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return optionalInt_; + } + /** + * optional int32 optional_int = 1; + * @param value The optionalInt to set. + */ + private void setOptionalInt(int value) { + bitField0_ |= 0x00000001; + optionalInt_ = value; + } + /** + * optional int32 optional_int = 1; + */ + private void clearOptionalInt() { + bitField0_ = (bitField0_ & ~0x00000001); + optionalInt_ = 0; + } + + public static final int SUB_MESSAGE_FIELD_NUMBER = 2; + private com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage subMessage_; + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + @java.lang.Override + public boolean hasSubMessage() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + @java.lang.Override + public com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage getSubMessage() { + return subMessage_ == null ? com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.getDefaultInstance() : subMessage_; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + private void setSubMessage(com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage value) { + value.getClass(); + subMessage_ = value; + bitField0_ |= 0x00000002; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeSubMessage(com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage value) { + value.getClass(); + if (subMessage_ != null && + subMessage_ != com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.getDefaultInstance()) { + subMessage_ = + com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.newBuilder(subMessage_).mergeFrom(value).buildPartial(); + } else { + subMessage_ = value; + } + bitField0_ |= 0x00000002; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + private void clearSubMessage() { subMessage_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.TestMessageLite2 prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.TestMessageLite2, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.TestMessageLite2) + com.google.common.truth.extensions.proto.TestMessageLite2OrBuilder { + // Construct using com.google.common.truth.extensions.proto.TestMessageLite2.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + @java.lang.Override + public boolean hasOptionalInt() { + return instance.hasOptionalInt(); + } + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return instance.getOptionalInt(); + } + /** + * optional int32 optional_int = 1; + * @param value The optionalInt to set. + * @return This builder for chaining. + */ + public Builder setOptionalInt(int value) { + copyOnWrite(); + instance.setOptionalInt(value); + return this; + } + /** + * optional int32 optional_int = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalInt() { + copyOnWrite(); + instance.clearOptionalInt(); + return this; + } + + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + @java.lang.Override + public boolean hasSubMessage() { + return instance.hasSubMessage(); + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + @java.lang.Override + public com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage getSubMessage() { + return instance.getSubMessage(); + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + public Builder setSubMessage(com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage value) { + copyOnWrite(); + instance.setSubMessage(value); + return this; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + public Builder setSubMessage( + com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage.Builder builderForValue) { + copyOnWrite(); + instance.setSubMessage(builderForValue.build()); + return this; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + public Builder mergeSubMessage(com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage value) { + copyOnWrite(); + instance.mergeSubMessage(value); + return this; + } + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + */ + public Builder clearSubMessage() { copyOnWrite(); + instance.clearSubMessage(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.TestMessageLite2) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.TestMessageLite2(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", + "optionalInt_", + "subMessage_", + }; + java.lang.String info = + "\u0001\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u1004\u0000\u0002" + + "\u1009\u0001"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.TestMessageLite2.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.TestMessageLite2) + private static final com.google.common.truth.extensions.proto.TestMessageLite2 DEFAULT_INSTANCE; + static { + TestMessageLite2 defaultInstance = new TestMessageLite2(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TestMessageLite2.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OrBuilder.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OrBuilder.java new file mode 100644 index 000000000..b279c7ebf --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +public interface TestMessageLite2OrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.TestMessageLite2) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 optional_int = 1; + * @return Whether the optionalInt field is set. + */ + boolean hasOptionalInt(); + /** + * optional int32 optional_int = 1; + * @return The optionalInt. + */ + int getOptionalInt(); + + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + * @return Whether the subMessage field is set. + */ + boolean hasSubMessage(); + /** + * optional .com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage sub_message = 2; + * @return The subMessage. + */ + com.google.common.truth.extensions.proto.TestMessageLite2.SubMessage getSubMessage(); +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OuterClass.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OuterClass.java new file mode 100644 index 000000000..1c00de4b6 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2OuterClass.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +public final class TestMessageLite2OuterClass { + private TestMessageLite2OuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFields.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFields.java new file mode 100644 index 000000000..b9dc155a5 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFields.java @@ -0,0 +1,372 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +/** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields} + */ +public final class TestMessageLite2WithRequiredFields extends + com.google.protobuf.GeneratedMessageLite< + TestMessageLite2WithRequiredFields, TestMessageLite2WithRequiredFields.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields) + TestMessageLite2WithRequiredFieldsOrBuilder { + private TestMessageLite2WithRequiredFields() { + optionalString_ = ""; + } + private int bitField0_; + public static final int REQUIRED_INT_FIELD_NUMBER = 1; + private int requiredInt_; + /** + * required int32 required_int = 1; + * @return Whether the requiredInt field is set. + */ + @java.lang.Override + public boolean hasRequiredInt() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 required_int = 1; + * @return The requiredInt. + */ + @java.lang.Override + public int getRequiredInt() { + return requiredInt_; + } + /** + * required int32 required_int = 1; + * @param value The requiredInt to set. + */ + private void setRequiredInt(int value) { + bitField0_ |= 0x00000001; + requiredInt_ = value; + } + /** + * required int32 required_int = 1; + */ + private void clearRequiredInt() { + bitField0_ = (bitField0_ & ~0x00000001); + requiredInt_ = 0; + } + + public static final int OPTIONAL_STRING_FIELD_NUMBER = 2; + private java.lang.String optionalString_; + /** + * optional string optional_string = 2; + * @return Whether the optionalString field is set. + */ + @java.lang.Override + public boolean hasOptionalString() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string optional_string = 2; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return optionalString_; + } + /** + * optional string optional_string = 2; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(optionalString_); + } + /** + * optional string optional_string = 2; + * @param value The optionalString to set. + */ + private void setOptionalString( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + bitField0_ |= 0x00000002; + optionalString_ = value; + } + /** + * optional string optional_string = 2; + */ + private void clearOptionalString() { + bitField0_ = (bitField0_ & ~0x00000002); + optionalString_ = getDefaultInstance().getOptionalString(); + } + /** + * optional string optional_string = 2; + * @param value The bytes for optionalString to set. + */ + private void setOptionalStringBytes( + com.google.protobuf.ByteString value) { + optionalString_ = value.toStringUtf8(); + bitField0_ |= 0x00000002; + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields) + com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFieldsOrBuilder { + // Construct using com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * required int32 required_int = 1; + * @return Whether the requiredInt field is set. + */ + @java.lang.Override + public boolean hasRequiredInt() { + return instance.hasRequiredInt(); + } + /** + * required int32 required_int = 1; + * @return The requiredInt. + */ + @java.lang.Override + public int getRequiredInt() { + return instance.getRequiredInt(); + } + /** + * required int32 required_int = 1; + * @param value The requiredInt to set. + * @return This builder for chaining. + */ + public Builder setRequiredInt(int value) { + copyOnWrite(); + instance.setRequiredInt(value); + return this; + } + /** + * required int32 required_int = 1; + * @return This builder for chaining. + */ + public Builder clearRequiredInt() { + copyOnWrite(); + instance.clearRequiredInt(); + return this; + } + + /** + * optional string optional_string = 2; + * @return Whether the optionalString field is set. + */ + @java.lang.Override + public boolean hasOptionalString() { + return instance.hasOptionalString(); + } + /** + * optional string optional_string = 2; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return instance.getOptionalString(); + } + /** + * optional string optional_string = 2; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return instance.getOptionalStringBytes(); + } + /** + * optional string optional_string = 2; + * @param value The optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalString( + java.lang.String value) { + copyOnWrite(); + instance.setOptionalString(value); + return this; + } + /** + * optional string optional_string = 2; + * @return This builder for chaining. + */ + public Builder clearOptionalString() { + copyOnWrite(); + instance.clearOptionalString(); + return this; + } + /** + * optional string optional_string = 2; + * @param value The bytes for optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalStringBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOptionalStringBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields) + } + private byte memoizedIsInitialized = 2; + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", + "requiredInt_", + "optionalString_", + }; + java.lang.String info = + "\u0001\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0001\u0001\u1504\u0000\u0002" + + "\u1008\u0001"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return memoizedIsInitialized; + } + case SET_MEMOIZED_IS_INITIALIZED: { + memoizedIsInitialized = (byte) (arg0 == null ? 0 : 1); + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields) + private static final com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields DEFAULT_INSTANCE; + static { + TestMessageLite2WithRequiredFields defaultInstance = new TestMessageLite2WithRequiredFields(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TestMessageLite2WithRequiredFields.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFieldsOrBuilder.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFieldsOrBuilder.java new file mode 100644 index 000000000..8ce42cf0e --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite2WithRequiredFieldsOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite2.proto + +package com.google.common.truth.extensions.proto; + +public interface TestMessageLite2WithRequiredFieldsOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.TestMessageLite2WithRequiredFields) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * required int32 required_int = 1; + * @return Whether the requiredInt field is set. + */ + boolean hasRequiredInt(); + /** + * required int32 required_int = 1; + * @return The requiredInt. + */ + int getRequiredInt(); + + /** + * optional string optional_string = 2; + * @return Whether the optionalString field is set. + */ + boolean hasOptionalString(); + /** + * optional string optional_string = 2; + * @return The optionalString. + */ + java.lang.String getOptionalString(); + /** + * optional string optional_string = 2; + * @return The bytes for optionalString. + */ + com.google.protobuf.ByteString + getOptionalStringBytes(); +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3.java new file mode 100644 index 000000000..8864fb109 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3.java @@ -0,0 +1,625 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite3.proto + +package com.google.common.truth.extensions.proto; + +/** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite3} + */ +public final class TestMessageLite3 extends + com.google.protobuf.GeneratedMessageLite< + TestMessageLite3, TestMessageLite3.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.TestMessageLite3) + TestMessageLite3OrBuilder { + private TestMessageLite3() { + } + public interface SubMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string optional_string = 1; + * @return The optionalString. + */ + java.lang.String getOptionalString(); + /** + * string optional_string = 1; + * @return The bytes for optionalString. + */ + com.google.protobuf.ByteString + getOptionalStringBytes(); + } + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage} + */ + public static final class SubMessage extends + com.google.protobuf.GeneratedMessageLite< + SubMessage, SubMessage.Builder> implements + // @@protoc_insertion_point(message_implements:com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage) + SubMessageOrBuilder { + private SubMessage() { + optionalString_ = ""; + } + public static final int OPTIONAL_STRING_FIELD_NUMBER = 1; + private java.lang.String optionalString_; + /** + * string optional_string = 1; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return optionalString_; + } + /** + * string optional_string = 1; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(optionalString_); + } + /** + * string optional_string = 1; + * @param value The optionalString to set. + */ + private void setOptionalString( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + optionalString_ = value; + } + /** + * string optional_string = 1; + */ + private void clearOptionalString() { + + optionalString_ = getDefaultInstance().getOptionalString(); + } + /** + * string optional_string = 1; + * @param value The bytes for optionalString to set. + */ + private void setOptionalStringBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + optionalString_ = value.toStringUtf8(); + + } + + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage) + com.google.common.truth.extensions.proto.TestMessageLite3.SubMessageOrBuilder { + // Construct using com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string optional_string = 1; + * @return The optionalString. + */ + @java.lang.Override + public java.lang.String getOptionalString() { + return instance.getOptionalString(); + } + /** + * string optional_string = 1; + * @return The bytes for optionalString. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOptionalStringBytes() { + return instance.getOptionalStringBytes(); + } + /** + * string optional_string = 1; + * @param value The optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalString( + java.lang.String value) { + copyOnWrite(); + instance.setOptionalString(value); + return this; + } + /** + * string optional_string = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalString() { + copyOnWrite(); + instance.clearOptionalString(); + return this; + } + /** + * string optional_string = 1; + * @param value The bytes for optionalString to set. + * @return This builder for chaining. + */ + public Builder setOptionalStringBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOptionalStringBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "optionalString_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage) + private static final com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage DEFAULT_INSTANCE; + static { + SubMessage defaultInstance = new SubMessage(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SubMessage.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public static final int OPTIONAL_INT_FIELD_NUMBER = 1; + private int optionalInt_; + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return optionalInt_; + } + /** + * int32 optional_int = 1; + * @param value The optionalInt to set. + */ + private void setOptionalInt(int value) { + + optionalInt_ = value; + } + /** + * int32 optional_int = 1; + */ + private void clearOptionalInt() { + + optionalInt_ = 0; + } + + public static final int SUB_MESSAGE_FIELD_NUMBER = 2; + private com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage subMessage_; + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + @java.lang.Override + public boolean hasSubMessage() { + return subMessage_ != null; + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + @java.lang.Override + public com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage getSubMessage() { + return subMessage_ == null ? com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.getDefaultInstance() : subMessage_; + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + private void setSubMessage(com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage value) { + value.getClass(); + subMessage_ = value; + + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeSubMessage(com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage value) { + value.getClass(); + if (subMessage_ != null && + subMessage_ != com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.getDefaultInstance()) { + subMessage_ = + com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.newBuilder(subMessage_).mergeFrom(value).buildPartial(); + } else { + subMessage_ = value; + } + + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + private void clearSubMessage() { subMessage_ = null; + + } + + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.google.common.truth.extensions.proto.TestMessageLite3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.google.common.truth.extensions.proto.TestMessageLite3 prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code com.google.common.truth.extensions.proto.TestMessageLite3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.google.common.truth.extensions.proto.TestMessageLite3, Builder> implements + // @@protoc_insertion_point(builder_implements:com.google.common.truth.extensions.proto.TestMessageLite3) + com.google.common.truth.extensions.proto.TestMessageLite3OrBuilder { + // Construct using com.google.common.truth.extensions.proto.TestMessageLite3.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + @java.lang.Override + public int getOptionalInt() { + return instance.getOptionalInt(); + } + /** + * int32 optional_int = 1; + * @param value The optionalInt to set. + * @return This builder for chaining. + */ + public Builder setOptionalInt(int value) { + copyOnWrite(); + instance.setOptionalInt(value); + return this; + } + /** + * int32 optional_int = 1; + * @return This builder for chaining. + */ + public Builder clearOptionalInt() { + copyOnWrite(); + instance.clearOptionalInt(); + return this; + } + + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + @java.lang.Override + public boolean hasSubMessage() { + return instance.hasSubMessage(); + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + @java.lang.Override + public com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage getSubMessage() { + return instance.getSubMessage(); + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + public Builder setSubMessage(com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage value) { + copyOnWrite(); + instance.setSubMessage(value); + return this; + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + public Builder setSubMessage( + com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage.Builder builderForValue) { + copyOnWrite(); + instance.setSubMessage(builderForValue.build()); + return this; + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + public Builder mergeSubMessage(com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage value) { + copyOnWrite(); + instance.mergeSubMessage(value); + return this; + } + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + */ + public Builder clearSubMessage() { copyOnWrite(); + instance.clearSubMessage(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.google.common.truth.extensions.proto.TestMessageLite3) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.google.common.truth.extensions.proto.TestMessageLite3(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "optionalInt_", + "subMessage_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0004\u0002\t" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.google.common.truth.extensions.proto.TestMessageLite3.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:com.google.common.truth.extensions.proto.TestMessageLite3) + private static final com.google.common.truth.extensions.proto.TestMessageLite3 DEFAULT_INSTANCE; + static { + TestMessageLite3 defaultInstance = new TestMessageLite3(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TestMessageLite3.class, defaultInstance); + } + + public static com.google.common.truth.extensions.proto.TestMessageLite3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OrBuilder.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OrBuilder.java new file mode 100644 index 000000000..9cfab6fc1 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite3.proto + +package com.google.common.truth.extensions.proto; + +public interface TestMessageLite3OrBuilder extends + // @@protoc_insertion_point(interface_extends:com.google.common.truth.extensions.proto.TestMessageLite3) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int32 optional_int = 1; + * @return The optionalInt. + */ + int getOptionalInt(); + + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + * @return Whether the subMessage field is set. + */ + boolean hasSubMessage(); + /** + * .com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage sub_message = 2; + * @return The subMessage. + */ + com.google.common.truth.extensions.proto.TestMessageLite3.SubMessage getSubMessage(); +} diff --git a/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OuterClass.java b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OuterClass.java new file mode 100644 index 000000000..ac9aa4c63 --- /dev/null +++ b/extensions/liteproto/pre-generated-test-sources/protobuf/java/com/google/common/truth/extensions/proto/TestMessageLite3OuterClass.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test_message_lite3.proto + +package com.google.common.truth.extensions.proto; + +public final class TestMessageLite3OuterClass { + private TestMessageLite3OuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/extensions/liteproto/src/test/proto/test_message_lite2.proto b/extensions/liteproto/src/test/proto/test_message_lite2.proto index c2dc2593a..bbd83ee4f 100644 --- a/extensions/liteproto/src/test/proto/test_message_lite2.proto +++ b/extensions/liteproto/src/test/proto/test_message_lite2.proto @@ -2,8 +2,6 @@ syntax = "proto2"; package com.google.common.truth.extensions.proto; -option optimize_for = LITE_RUNTIME; - option java_package = "com.google.common.truth.extensions.proto"; option java_multiple_files = true; diff --git a/extensions/liteproto/src/test/proto/test_message_lite3.proto b/extensions/liteproto/src/test/proto/test_message_lite3.proto index ba3e3414b..8be46f4b1 100644 --- a/extensions/liteproto/src/test/proto/test_message_lite3.proto +++ b/extensions/liteproto/src/test/proto/test_message_lite3.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package com.google.common.truth.extensions.proto; -option optimize_for = LITE_RUNTIME; - option java_package = "com.google.common.truth.extensions.proto"; option java_multiple_files = true; diff --git a/pom.xml b/pom.xml index 05d24fa47..0e30f68e7 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,6 @@ 31.1-jre 2.9.0 3.21.9 - - - 3.1.0 1.7.0 @@ -129,8 +126,8 @@ com.google.protobuf - protobuf-lite - 3.0.1 + protobuf-javalite + ${protobuf.version} com.google.re2j @@ -231,6 +228,11 @@ maven-project-info-reports-plugin 3.4.1 + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + maven-javadoc-plugin ${maven-javadoc-plugin.version}