github-advanced-security[bot] commented on code in PR #3367:
URL: https://github.com/apache/avro/pull/3367#discussion_r2132492231
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
Review Comment:
## Missing Override annotation
This method overrides [EnumLiteMap<Status>.findValueByNumber](1); it is
advisable to add an Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3336)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
Review Comment:
## Missing Override annotation
This method overrides [ProtocolMessageEnum.getValueDescriptor](1); it is
advisable to add an Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3332)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException("Can't get the descriptor of
an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+
+ public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
Review Comment:
## Missing Override annotation
This method overrides [ProtocolMessageEnum.getDescriptorForType](1); it is
advisable to add an Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3331)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException("Can't get the descriptor of
an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+
+ public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
+ return getDescriptor();
+ }
+
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException("EnumValueDescriptor is
not for this type.");
+ }
+ if (desc.getIndex() == -1) {
+ return UNRECOGNIZED;
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Status(int value) {
+ this.value = value;
+ }
+
+ //
@@protoc_insertion_point(enum_scope:org.apache.avro.protobuf.noopt.Status)
+ }
+
+ public interface UserOrBuilder extends
+ //
@@protoc_insertion_point(interface_extends:org.apache.avro.protobuf.noopt.User)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ int getId();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ int getStatusValue();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ org.apache.avro.protobuf.noopt.TestProto3.Status getStatus();
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class User extends com.google.protobuf.GeneratedMessage
implements
+ //
@@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.User)
+ UserOrBuilder {
+ private static final long serialVersionUID = 0L;
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", User.class.getName());
+ }
+
+ // Use User.newBuilder() to construct.
+ private User(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ }
+
+ private User() {
+ name_ = "";
+ status_ = 0;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ public static final int NAME_FIELD_NUMBER = 1;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString)
ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ID_FIELD_NUMBER = 2;
+ private int id_ = 0;
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ @java.lang.Override
+ public int getId() {
+ return id_;
+ }
+
+ public static final int STATUS_FIELD_NUMBER = 3;
+ private int status_ = 0;
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ @java.lang.Override
+ public int getStatusValue() {
+ return status_;
+ }
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.Status getStatus() {
+ org.apache.avro.protobuf.noopt.TestProto3.Status result =
org.apache.avro.protobuf.noopt.TestProto3.Status
+ .forNumber(status_);
+ return result == null ?
org.apache.avro.protobuf.noopt.TestProto3.Status.UNRECOGNIZED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1)
+ return true;
+ if (isInitialized == 0)
+ return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws
java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
+ }
+ if (id_ != 0) {
+ output.writeInt32(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ output.writeEnum(3, status_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1)
+ return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ size += com.google.protobuf.GeneratedMessage.computeStringSize(1,
name_);
+ }
+ if (id_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(3,
status_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.apache.avro.protobuf.noopt.TestProto3.User)) {
+ return super.equals(obj);
+ }
+ org.apache.avro.protobuf.noopt.TestProto3.User other =
(org.apache.avro.protobuf.noopt.TestProto3.User) obj;
+
+ if (!getName().equals(other.getName()))
+ return false;
+ if (getId() != other.getId())
+ return false;
+ if (status_ != other.status_)
+ return false;
+ if (!getUnknownFields().equals(other.getUnknownFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId();
+ hash = (37 * hash) + STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + status_;
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder
newBuilder(org.apache.avro.protobuf.noopt.TestProto3.User prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new
Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
Review Comment:
## No clone method
No clone method, yet implements Cloneable.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3338)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException("Can't get the descriptor of
an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+
+ public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
+ return getDescriptor();
+ }
+
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException("EnumValueDescriptor is
not for this type.");
+ }
+ if (desc.getIndex() == -1) {
+ return UNRECOGNIZED;
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Status(int value) {
+ this.value = value;
+ }
+
+ //
@@protoc_insertion_point(enum_scope:org.apache.avro.protobuf.noopt.Status)
+ }
+
+ public interface UserOrBuilder extends
+ //
@@protoc_insertion_point(interface_extends:org.apache.avro.protobuf.noopt.User)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ int getId();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ int getStatusValue();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ org.apache.avro.protobuf.noopt.TestProto3.Status getStatus();
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class User extends com.google.protobuf.GeneratedMessage
implements
+ //
@@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.User)
+ UserOrBuilder {
+ private static final long serialVersionUID = 0L;
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", User.class.getName());
+ }
+
+ // Use User.newBuilder() to construct.
+ private User(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ }
+
+ private User() {
+ name_ = "";
+ status_ = 0;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ public static final int NAME_FIELD_NUMBER = 1;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString)
ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ID_FIELD_NUMBER = 2;
+ private int id_ = 0;
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ @java.lang.Override
+ public int getId() {
+ return id_;
+ }
+
+ public static final int STATUS_FIELD_NUMBER = 3;
+ private int status_ = 0;
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ @java.lang.Override
+ public int getStatusValue() {
+ return status_;
+ }
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.Status getStatus() {
+ org.apache.avro.protobuf.noopt.TestProto3.Status result =
org.apache.avro.protobuf.noopt.TestProto3.Status
+ .forNumber(status_);
+ return result == null ?
org.apache.avro.protobuf.noopt.TestProto3.Status.UNRECOGNIZED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1)
+ return true;
+ if (isInitialized == 0)
+ return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws
java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
+ }
+ if (id_ != 0) {
+ output.writeInt32(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ output.writeEnum(3, status_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1)
+ return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ size += com.google.protobuf.GeneratedMessage.computeStringSize(1,
name_);
+ }
+ if (id_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(3,
status_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.apache.avro.protobuf.noopt.TestProto3.User)) {
+ return super.equals(obj);
+ }
+ org.apache.avro.protobuf.noopt.TestProto3.User other =
(org.apache.avro.protobuf.noopt.TestProto3.User) obj;
+
+ if (!getName().equals(other.getName()))
+ return false;
+ if (getId() != other.getId())
+ return false;
+ if (status_ != other.status_)
+ return false;
+ if (!getUnknownFields().equals(other.getUnknownFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId();
+ hash = (37 * hash) + STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + status_;
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder
newBuilder(org.apache.avro.protobuf.noopt.TestProto3.User prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new
Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
+ //
@@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.noopt.User)
+ org.apache.avro.protobuf.noopt.TestProto3.UserOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ // Construct using
org.apache.avro.protobuf.noopt.TestProto3.User.newBuilder()
+ private Builder() {
+
+ }
+
+ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent
parent) {
+ super(parent);
+
+ }
+
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ bitField0_ = 0;
+ name_ = "";
+ id_ = 0;
+ status_ = 0;
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
{
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User
getDefaultInstanceForType() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.User.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User build() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User buildPartial() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = new
org.apache.avro.protobuf.noopt.TestProto3.User(
+ this);
+ if (bitField0_ != 0) {
+ buildPartial0(result);
+ }
+ onBuilt();
+ return result;
+ }
+
+ private void
buildPartial0(org.apache.avro.protobuf.noopt.TestProto3.User result) {
+ int from_bitField0_ = bitField0_;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.name_ = name_;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.id_ = id_;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.status_ = status_;
+ }
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
Review Comment:
## Confusing overloading of methods
Method Builder.mergeFrom(..) could be confused with overloaded method
[Builder.mergeFrom](1), since dispatch depends on static types.
Method Builder.mergeFrom(..) could be confused with overloaded method
[mergeFrom](2), since dispatch depends on static types.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3337)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException("Can't get the descriptor of
an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+
+ public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
+ return getDescriptor();
+ }
+
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException("EnumValueDescriptor is
not for this type.");
+ }
+ if (desc.getIndex() == -1) {
+ return UNRECOGNIZED;
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Status(int value) {
+ this.value = value;
+ }
+
+ //
@@protoc_insertion_point(enum_scope:org.apache.avro.protobuf.noopt.Status)
+ }
+
+ public interface UserOrBuilder extends
+ //
@@protoc_insertion_point(interface_extends:org.apache.avro.protobuf.noopt.User)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ int getId();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ int getStatusValue();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ org.apache.avro.protobuf.noopt.TestProto3.Status getStatus();
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class User extends com.google.protobuf.GeneratedMessage
implements
+ //
@@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.User)
+ UserOrBuilder {
+ private static final long serialVersionUID = 0L;
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", User.class.getName());
+ }
+
+ // Use User.newBuilder() to construct.
+ private User(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ }
+
+ private User() {
+ name_ = "";
+ status_ = 0;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ public static final int NAME_FIELD_NUMBER = 1;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString)
ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ID_FIELD_NUMBER = 2;
+ private int id_ = 0;
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ @java.lang.Override
+ public int getId() {
+ return id_;
+ }
+
+ public static final int STATUS_FIELD_NUMBER = 3;
+ private int status_ = 0;
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ @java.lang.Override
+ public int getStatusValue() {
+ return status_;
+ }
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.Status getStatus() {
+ org.apache.avro.protobuf.noopt.TestProto3.Status result =
org.apache.avro.protobuf.noopt.TestProto3.Status
+ .forNumber(status_);
+ return result == null ?
org.apache.avro.protobuf.noopt.TestProto3.Status.UNRECOGNIZED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1)
+ return true;
+ if (isInitialized == 0)
+ return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws
java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
+ }
+ if (id_ != 0) {
+ output.writeInt32(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ output.writeEnum(3, status_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1)
+ return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ size += com.google.protobuf.GeneratedMessage.computeStringSize(1,
name_);
+ }
+ if (id_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(3,
status_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.apache.avro.protobuf.noopt.TestProto3.User)) {
+ return super.equals(obj);
+ }
+ org.apache.avro.protobuf.noopt.TestProto3.User other =
(org.apache.avro.protobuf.noopt.TestProto3.User) obj;
+
+ if (!getName().equals(other.getName()))
+ return false;
+ if (getId() != other.getId())
+ return false;
+ if (status_ != other.status_)
+ return false;
+ if (!getUnknownFields().equals(other.getUnknownFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId();
+ hash = (37 * hash) + STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + status_;
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder
newBuilder(org.apache.avro.protobuf.noopt.TestProto3.User prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new
Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
+ //
@@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.noopt.User)
+ org.apache.avro.protobuf.noopt.TestProto3.UserOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ // Construct using
org.apache.avro.protobuf.noopt.TestProto3.User.newBuilder()
+ private Builder() {
+
+ }
+
+ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent
parent) {
+ super(parent);
+
+ }
+
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ bitField0_ = 0;
+ name_ = "";
+ id_ = 0;
+ status_ = 0;
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
{
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User
getDefaultInstanceForType() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.User.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User build() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User buildPartial() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = new
org.apache.avro.protobuf.noopt.TestProto3.User(
+ this);
+ if (bitField0_ != 0) {
+ buildPartial0(result);
+ }
+ onBuilt();
+ return result;
+ }
+
+ private void
buildPartial0(org.apache.avro.protobuf.noopt.TestProto3.User result) {
+ int from_bitField0_ = bitField0_;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.name_ = name_;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.id_ = id_;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.status_ = status_;
+ }
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.avro.protobuf.noopt.TestProto3.User) {
+ return mergeFrom((org.apache.avro.protobuf.noopt.TestProto3.User)
other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.avro.protobuf.noopt.TestProto3.User
other) {
+ if (other ==
org.apache.avro.protobuf.noopt.TestProto3.User.getDefaultInstance())
+ return this;
+ if (!other.getName().isEmpty()) {
+ name_ = other.name_;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ }
+ if (other.getId() != 0) {
+ setId(other.getId());
+ }
+ if (other.status_ != 0) {
+ setStatusValue(other.getStatusValue());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ name_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000001;
+ break;
+ } // case 10
+ case 16: {
+ id_ = input.readInt32();
+ bitField0_ |= 0x00000002;
+ break;
+ } // case 16
+ case 24: {
+ status_ = input.readEnum();
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 24
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.unwrapIOException();
+ } finally {
+ onChanged();
+ } // finally
+ return this;
+ }
+
+ private int bitField0_;
+
+ private java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString)
ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ public com.google.protobuf.ByteString getNameBytes() {
Review Comment:
## Missing Override annotation
This method overrides [UserOrBuilder.getNameBytes](1); it is advisable to
add an Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3334)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
Review Comment:
## Useless parameter
The parameter 'registry' is never used.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3330)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
Review Comment:
## Missing Override annotation
This method overrides [ProtocolMessageEnum.getNumber](1); it is advisable to
add an Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3333)
##########
lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/TestProto3.java:
##########
@@ -0,0 +1,883 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: src/test/protobuf/test_proto3.proto
+// Protobuf Java Version: 4.29.3
+
+package org.apache.avro.protobuf.noopt;
+
+public final class TestProto3 {
+ private TestProto3() {
+ }
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */
4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", TestProto3.class.getName());
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void
registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite)
registry);
+ }
+
+ /**
+ * Protobuf enum {@code org.apache.avro.protobuf.noopt.Status}
+ */
+ public enum Status implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ STATUS_UNKNOWN(0),
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ STATUS_ACTIVE(1),
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ STATUS_INACTIVE(2), UNRECOGNIZED(-1),;
+
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", Status.class.getName());
+ }
+ /**
+ * <code>STATUS_UNKNOWN = 0;</code>
+ */
+ public static final int STATUS_UNKNOWN_VALUE = 0;
+ /**
+ * <code>STATUS_ACTIVE = 1;</code>
+ */
+ public static final int STATUS_ACTIVE_VALUE = 1;
+ /**
+ * <code>STATUS_INACTIVE = 2;</code>
+ */
+ public static final int STATUS_INACTIVE_VALUE = 2;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException("Can't get the number of
an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Status valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Status forNumber(int value) {
+ switch (value) {
+ case 0:
+ return STATUS_UNKNOWN;
+ case 1:
+ return STATUS_ACTIVE;
+ case 2:
+ return STATUS_INACTIVE;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
internalGetValueMap() {
+ return internalValueMap;
+ }
+
+ private static final com.google.protobuf.Internal.EnumLiteMap<Status>
internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException("Can't get the descriptor of
an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+
+ public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
+ return getDescriptor();
+ }
+
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException("EnumValueDescriptor is
not for this type.");
+ }
+ if (desc.getIndex() == -1) {
+ return UNRECOGNIZED;
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Status(int value) {
+ this.value = value;
+ }
+
+ //
@@protoc_insertion_point(enum_scope:org.apache.avro.protobuf.noopt.Status)
+ }
+
+ public interface UserOrBuilder extends
+ //
@@protoc_insertion_point(interface_extends:org.apache.avro.protobuf.noopt.User)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ int getId();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ int getStatusValue();
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ org.apache.avro.protobuf.noopt.TestProto3.Status getStatus();
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class User extends com.google.protobuf.GeneratedMessage
implements
+ //
@@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.User)
+ UserOrBuilder {
+ private static final long serialVersionUID = 0L;
+ static {
+ com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
+ com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major=
*/ 4, /* minor= */ 29, /* patch= */ 3,
+ /* suffix= */ "", User.class.getName());
+ }
+
+ // Use User.newBuilder() to construct.
+ private User(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ }
+
+ private User() {
+ name_ = "";
+ status_ = 0;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ public static final int NAME_FIELD_NUMBER = 1;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString)
ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ID_FIELD_NUMBER = 2;
+ private int id_ = 0;
+
+ /**
+ * <code>int32 id = 2;</code>
+ *
+ * @return The id.
+ */
+ @java.lang.Override
+ public int getId() {
+ return id_;
+ }
+
+ public static final int STATUS_FIELD_NUMBER = 3;
+ private int status_ = 0;
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The enum numeric value on the wire for status.
+ */
+ @java.lang.Override
+ public int getStatusValue() {
+ return status_;
+ }
+
+ /**
+ * <code>.org.apache.avro.protobuf.noopt.Status status = 3;</code>
+ *
+ * @return The status.
+ */
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.Status getStatus() {
+ org.apache.avro.protobuf.noopt.TestProto3.Status result =
org.apache.avro.protobuf.noopt.TestProto3.Status
+ .forNumber(status_);
+ return result == null ?
org.apache.avro.protobuf.noopt.TestProto3.Status.UNRECOGNIZED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1)
+ return true;
+ if (isInitialized == 0)
+ return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws
java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
+ }
+ if (id_ != 0) {
+ output.writeInt32(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ output.writeEnum(3, status_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1)
+ return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
+ size += com.google.protobuf.GeneratedMessage.computeStringSize(1,
name_);
+ }
+ if (id_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, id_);
+ }
+ if (status_ !=
org.apache.avro.protobuf.noopt.TestProto3.Status.STATUS_UNKNOWN.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(3,
status_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.apache.avro.protobuf.noopt.TestProto3.User)) {
+ return super.equals(obj);
+ }
+ org.apache.avro.protobuf.noopt.TestProto3.User other =
(org.apache.avro.protobuf.noopt.TestProto3.User) obj;
+
+ if (!getName().equals(other.getName()))
+ return false;
+ if (getId() != other.getId())
+ return false;
+ if (status_ != other.status_)
+ return false;
+ if (!getUnknownFields().equals(other.getUnknownFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId();
+ hash = (37 * hash) + STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + status_;
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseDelimitedFrom(java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return
com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input);
+ }
+
+ public static org.apache.avro.protobuf.noopt.TestProto3.User
parseFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER,
input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder
newBuilder(org.apache.avro.protobuf.noopt.TestProto3.User prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new
Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+
+ /**
+ * Protobuf type {@code org.apache.avro.protobuf.noopt.User}
+ */
+ public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
+ //
@@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.noopt.User)
+ org.apache.avro.protobuf.noopt.TestProto3.UserOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_fieldAccessorTable
+
.ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.TestProto3.User.class,
+ org.apache.avro.protobuf.noopt.TestProto3.User.Builder.class);
+ }
+
+ // Construct using
org.apache.avro.protobuf.noopt.TestProto3.User.newBuilder()
+ private Builder() {
+
+ }
+
+ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent
parent) {
+ super(parent);
+
+ }
+
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ bitField0_ = 0;
+ name_ = "";
+ id_ = 0;
+ status_ = 0;
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
{
+ return
org.apache.avro.protobuf.noopt.TestProto3.internal_static_org_apache_avro_protobuf_noopt_User_descriptor;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User
getDefaultInstanceForType() {
+ return
org.apache.avro.protobuf.noopt.TestProto3.User.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User build() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public org.apache.avro.protobuf.noopt.TestProto3.User buildPartial() {
+ org.apache.avro.protobuf.noopt.TestProto3.User result = new
org.apache.avro.protobuf.noopt.TestProto3.User(
+ this);
+ if (bitField0_ != 0) {
+ buildPartial0(result);
+ }
+ onBuilt();
+ return result;
+ }
+
+ private void
buildPartial0(org.apache.avro.protobuf.noopt.TestProto3.User result) {
+ int from_bitField0_ = bitField0_;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.name_ = name_;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.id_ = id_;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.status_ = status_;
+ }
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.avro.protobuf.noopt.TestProto3.User) {
+ return mergeFrom((org.apache.avro.protobuf.noopt.TestProto3.User)
other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.avro.protobuf.noopt.TestProto3.User
other) {
+ if (other ==
org.apache.avro.protobuf.noopt.TestProto3.User.getDefaultInstance())
+ return this;
+ if (!other.getName().isEmpty()) {
+ name_ = other.name_;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ }
+ if (other.getId() != 0) {
+ setId(other.getId());
+ }
+ if (other.status_ != 0) {
+ setStatusValue(other.getStatusValue());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws
java.io.IOException {
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ name_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000001;
+ break;
+ } // case 10
+ case 16: {
+ id_ = input.readInt32();
+ bitField0_ |= 0x00000002;
+ break;
+ } // case 16
+ case 24: {
+ status_ = input.readEnum();
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 24
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.unwrapIOException();
+ } finally {
+ onChanged();
+ } // finally
+ return this;
+ }
+
+ private int bitField0_;
+
+ private java.lang.Object name_ = "";
+
+ /**
+ * <code>string name = 1;</code>
+ *
+ * @return The name.
+ */
+ public java.lang.String getName() {
Review Comment:
## Missing Override annotation
This method overrides [UserOrBuilder.getName](1); it is advisable to add an
Override annotation.
[Show more
details](https://github.com/apache/avro/security/code-scanning/3335)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]