diff --git a/java/core/src/main/java/com/google/protobuf/Descriptors.java b/java/core/src/main/java/com/google/protobuf/Descriptors.java index 459dc6d44d41..1a4380a13a58 100644 --- a/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/java/core/src/main/java/com/google/protobuf/Descriptors.java @@ -360,50 +360,6 @@ private static FileDescriptor[] findDescriptors( return descriptors.toArray(new FileDescriptor[0]); } - /** - * This method is for backward compatibility with generated code which passed an - * InternalDescriptorAssigner. - */ - @Deprecated - public static void internalBuildGeneratedFileFrom( - final String[] descriptorDataParts, - final FileDescriptor[] dependencies, - final InternalDescriptorAssigner descriptorAssigner) { - final byte[] descriptorBytes = latin1Cat(descriptorDataParts); - - FileDescriptorProto proto; - try { - proto = FileDescriptorProto.parseFrom(descriptorBytes); - } catch (InvalidProtocolBufferException e) { - throw new IllegalArgumentException( - "Failed to parse protocol buffer descriptor for generated code.", e); - } - - final FileDescriptor result; - try { - // When building descriptors for generated code, we allow unknown - // dependencies by default. - result = buildFrom(proto, dependencies, true); - } catch (DescriptorValidationException e) { - throw new IllegalArgumentException( - "Invalid embedded descriptor for \"" + proto.getName() + "\".", e); - } - - final ExtensionRegistry registry = descriptorAssigner.assignDescriptors(result); - - if (registry != null) { - // We must re-parse the proto using the registry. - try { - proto = FileDescriptorProto.parseFrom(descriptorBytes, registry); - } catch (InvalidProtocolBufferException e) { - throw new IllegalArgumentException( - "Failed to parse protocol buffer descriptor for generated code.", e); - } - - result.setProto(proto); - } - } - /** * This method is to be called by generated code only. It is equivalent to {@code buildFrom} * except that the {@code FileDescriptorProto} is encoded in protocol buffer wire format. @@ -430,22 +386,6 @@ public static FileDescriptor internalBuildGeneratedFileFrom( } } - /** - * This method is for backward compatibility with generated code which passed an - * InternalDescriptorAssigner. - */ - @Deprecated - public static void internalBuildGeneratedFileFrom( - final String[] descriptorDataParts, - final Class descriptorOuterClass, - final String[] dependencyClassNames, - final String[] dependencyFileNames, - final InternalDescriptorAssigner descriptorAssigner) { - FileDescriptor[] dependencies = - findDescriptors(descriptorOuterClass, dependencyClassNames, dependencyFileNames); - internalBuildGeneratedFileFrom(descriptorDataParts, dependencies, descriptorAssigner); - } - /** * This method is to be called by generated code only. It uses Java reflection to load the * dependencies' descriptors. @@ -2011,6 +1951,7 @@ private void setProto(final EnumDescriptorProto proto) { * number. In generated Java code, all values with the same number after the first become aliases * of the first. However, they still have independent EnumValueDescriptors. */ + @SuppressWarnings("ShouldNotSubclass") public static final class EnumValueDescriptor extends GenericDescriptor implements Internal.EnumLite { static final Comparator BY_NUMBER = diff --git a/ruby/src/main/java/BUILD.bazel b/ruby/src/main/java/BUILD.bazel index 43945345ab95..e846c3b5a08c 100644 --- a/ruby/src/main/java/BUILD.bazel +++ b/ruby/src/main/java/BUILD.bazel @@ -1,6 +1,5 @@ -load("@rules_java//java:defs.bzl", "java_library", "java_lite_proto_library", "java_proto_library") +load("@rules_java//java:defs.bzl", "java_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("@rules_proto//proto:defs.bzl", "proto_library") java_library( name = "protobuf_java", @@ -21,21 +20,10 @@ java_library( ], ) -proto_library( - name = "sentinel_proto", - srcs = ["sentinel.proto"], -) - -java_proto_library( - name = "sentinel_java_proto", - deps = [":sentinel_proto"], -) - pkg_files( name = "dist_files", srcs = glob([ "**/*.java", - "**/*.proto", ]), strip_prefix = strip_prefix.from_root(""), visibility = ["//ruby:__pkg__"], diff --git a/ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java b/ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java index 595afbc246d1..144e7b97379c 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java @@ -400,35 +400,30 @@ protected int size() { } private IRubyObject defaultValue(ThreadContext context) { - SentinelOuterClass.Sentinel sentinel = SentinelOuterClass.Sentinel.getDefaultInstance(); Object value; switch (fieldType) { case INT32: - value = sentinel.getDefaultInt32(); - break; - case INT64: - value = sentinel.getDefaultInt64(); - break; case UINT32: - value = sentinel.getDefaultUnit32(); + value = 0; break; + case INT64: case UINT64: - value = sentinel.getDefaultUint64(); + value = 0L; break; case FLOAT: - value = sentinel.getDefaultFloat(); + value = 0F; break; case DOUBLE: - value = sentinel.getDefaultDouble(); + value = 0D; break; case BOOL: - value = sentinel.getDefaultBool(); + value = false; break; case BYTES: - value = sentinel.getDefaultBytes(); + value = com.google.protobuf.ByteString.EMPTY; break; case STRING: - value = sentinel.getDefaultString(); + value = ""; break; case ENUM: IRubyObject defaultEnumLoc = context.runtime.newFixnum(0); diff --git a/ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java b/ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java deleted file mode 100644 index 3c56cf86a834..000000000000 --- a/ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java +++ /dev/null @@ -1,693 +0,0 @@ -/* - * Protocol Buffers - Google's data interchange format - * Copyright 2014 Google Inc. All rights reserved. - * https://developers.google.com/protocol-buffers/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: sentinel.proto - -package com.google.protobuf.jruby; - -public final class SentinelOuterClass { - private SentinelOuterClass() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {} - - public interface SentinelOrBuilder - extends - // @@protoc_insertion_point(interface_extends:com.google.protobuf.jruby.Sentinel) - com.google.protobuf.MessageOrBuilder { - - /** optional int32 default_int32 = 1; */ - int getDefaultInt32(); - - /** optional int64 default_int64 = 2; */ - long getDefaultInt64(); - - /** optional uint32 default_unit32 = 3; */ - int getDefaultUnit32(); - - /** optional uint64 default_uint64 = 4; */ - long getDefaultUint64(); - - /** optional string default_string = 5; */ - java.lang.String getDefaultString(); - /** optional string default_string = 5; */ - com.google.protobuf.ByteString getDefaultStringBytes(); - - /** optional bool default_bool = 6; */ - boolean getDefaultBool(); - - /** optional float default_float = 7; */ - float getDefaultFloat(); - - /** optional double default_double = 8; */ - double getDefaultDouble(); - - /** optional bytes default_bytes = 9; */ - com.google.protobuf.ByteString getDefaultBytes(); - } - /** Protobuf type {@code com.google.protobuf.jruby.Sentinel} */ - public static final class Sentinel extends com.google.protobuf.GeneratedMessage - implements - // @@protoc_insertion_point(message_implements:com.google.protobuf.jruby.Sentinel) - SentinelOrBuilder { - // Use Sentinel.newBuilder() to construct. - private Sentinel(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Sentinel() { - defaultInt32_ = 0; - defaultInt64_ = 0L; - defaultUnit32_ = 0; - defaultUint64_ = 0L; - defaultString_ = ""; - defaultBool_ = false; - defaultFloat_ = 0F; - defaultDouble_ = 0D; - defaultBytes_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.protobuf.jruby.SentinelOuterClass - .internal_static_com_google_protobuf_jruby_Sentinel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.protobuf.jruby.SentinelOuterClass - .internal_static_com_google_protobuf_jruby_Sentinel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.protobuf.jruby.SentinelOuterClass.Sentinel.class, - com.google.protobuf.jruby.SentinelOuterClass.Sentinel.Builder.class); - } - - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Sentinel parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public static final int DEFAULT_INT32_FIELD_NUMBER = 1; - private int defaultInt32_; - /** optional int32 default_int32 = 1; */ - public int getDefaultInt32() { - return defaultInt32_; - } - - public static final int DEFAULT_INT64_FIELD_NUMBER = 2; - private long defaultInt64_; - /** optional int64 default_int64 = 2; */ - public long getDefaultInt64() { - return defaultInt64_; - } - - public static final int DEFAULT_UNIT32_FIELD_NUMBER = 3; - private int defaultUnit32_; - /** optional uint32 default_unit32 = 3; */ - public int getDefaultUnit32() { - return defaultUnit32_; - } - - public static final int DEFAULT_UINT64_FIELD_NUMBER = 4; - private long defaultUint64_; - /** optional uint64 default_uint64 = 4; */ - public long getDefaultUint64() { - return defaultUint64_; - } - - public static final int DEFAULT_STRING_FIELD_NUMBER = 5; - private java.lang.Object defaultString_; - /** optional string default_string = 5; */ - public java.lang.String getDefaultString() { - java.lang.Object ref = defaultString_; - 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(); - if (bs.isValidUtf8()) { - defaultString_ = s; - } - return s; - } - } - /** optional string default_string = 5; */ - public com.google.protobuf.ByteString getDefaultStringBytes() { - java.lang.Object ref = defaultString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - defaultString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFAULT_BOOL_FIELD_NUMBER = 6; - private boolean defaultBool_; - /** optional bool default_bool = 6; */ - public boolean getDefaultBool() { - return defaultBool_; - } - - public static final int DEFAULT_FLOAT_FIELD_NUMBER = 7; - private float defaultFloat_; - /** optional float default_float = 7; */ - public float getDefaultFloat() { - return defaultFloat_; - } - - public static final int DEFAULT_DOUBLE_FIELD_NUMBER = 8; - private double defaultDouble_; - /** optional double default_double = 8; */ - public double getDefaultDouble() { - return defaultDouble_; - } - - public static final int DEFAULT_BYTES_FIELD_NUMBER = 9; - private com.google.protobuf.ByteString defaultBytes_; - /** optional bytes default_bytes = 9; */ - public com.google.protobuf.ByteString getDefaultBytes() { - return defaultBytes_; - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder( - com.google.protobuf.jruby.SentinelOuterClass.Sentinel prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** Protobuf type {@code com.google.protobuf.jruby.Sentinel} */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements - // @@protoc_insertion_point(builder_implements:com.google.protobuf.jruby.Sentinel) - com.google.protobuf.jruby.SentinelOuterClass.SentinelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.protobuf.jruby.SentinelOuterClass - .internal_static_com_google_protobuf_jruby_Sentinel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.protobuf.jruby.SentinelOuterClass - .internal_static_com_google_protobuf_jruby_Sentinel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.protobuf.jruby.SentinelOuterClass.Sentinel.class, - com.google.protobuf.jruby.SentinelOuterClass.Sentinel.Builder.class); - } - - // Construct using com.google.protobuf.jruby.SentinelOuterClass.Sentinel.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - defaultInt32_ = 0; - - defaultInt64_ = 0L; - - defaultUnit32_ = 0; - - defaultUint64_ = 0L; - - defaultString_ = ""; - - defaultBool_ = false; - - defaultFloat_ = 0F; - - defaultDouble_ = 0D; - - defaultBytes_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.protobuf.jruby.SentinelOuterClass - .internal_static_com_google_protobuf_jruby_Sentinel_descriptor; - } - - public com.google.protobuf.jruby.SentinelOuterClass.Sentinel getDefaultInstanceForType() { - return com.google.protobuf.jruby.SentinelOuterClass.Sentinel.getDefaultInstance(); - } - - public com.google.protobuf.jruby.SentinelOuterClass.Sentinel build() { - com.google.protobuf.jruby.SentinelOuterClass.Sentinel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.protobuf.jruby.SentinelOuterClass.Sentinel buildPartial() { - com.google.protobuf.jruby.SentinelOuterClass.Sentinel result = - new com.google.protobuf.jruby.SentinelOuterClass.Sentinel(this); - result.defaultInt32_ = defaultInt32_; - result.defaultInt64_ = defaultInt64_; - result.defaultUnit32_ = defaultUnit32_; - result.defaultUint64_ = defaultUint64_; - result.defaultString_ = defaultString_; - result.defaultBool_ = defaultBool_; - result.defaultFloat_ = defaultFloat_; - result.defaultDouble_ = defaultDouble_; - result.defaultBytes_ = defaultBytes_; - onBuilt(); - return result; - } - - private int defaultInt32_; - /** optional int32 default_int32 = 1; */ - public int getDefaultInt32() { - return defaultInt32_; - } - /** optional int32 default_int32 = 1; */ - public Builder setDefaultInt32(int value) { - - defaultInt32_ = value; - onChanged(); - return this; - } - /** optional int32 default_int32 = 1; */ - public Builder clearDefaultInt32() { - - defaultInt32_ = 0; - onChanged(); - return this; - } - - private long defaultInt64_; - /** optional int64 default_int64 = 2; */ - public long getDefaultInt64() { - return defaultInt64_; - } - /** optional int64 default_int64 = 2; */ - public Builder setDefaultInt64(long value) { - - defaultInt64_ = value; - onChanged(); - return this; - } - /** optional int64 default_int64 = 2; */ - public Builder clearDefaultInt64() { - - defaultInt64_ = 0L; - onChanged(); - return this; - } - - private int defaultUnit32_; - /** optional uint32 default_unit32 = 3; */ - public int getDefaultUnit32() { - return defaultUnit32_; - } - /** optional uint32 default_unit32 = 3; */ - public Builder setDefaultUnit32(int value) { - - defaultUnit32_ = value; - onChanged(); - return this; - } - /** optional uint32 default_unit32 = 3; */ - public Builder clearDefaultUnit32() { - - defaultUnit32_ = 0; - onChanged(); - return this; - } - - private long defaultUint64_; - /** optional uint64 default_uint64 = 4; */ - public long getDefaultUint64() { - return defaultUint64_; - } - /** optional uint64 default_uint64 = 4; */ - public Builder setDefaultUint64(long value) { - - defaultUint64_ = value; - onChanged(); - return this; - } - /** optional uint64 default_uint64 = 4; */ - public Builder clearDefaultUint64() { - - defaultUint64_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object defaultString_ = ""; - /** optional string default_string = 5; */ - public java.lang.String getDefaultString() { - java.lang.Object ref = defaultString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - defaultString_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** optional string default_string = 5; */ - public com.google.protobuf.ByteString getDefaultStringBytes() { - java.lang.Object ref = defaultString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - defaultString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** optional string default_string = 5; */ - public Builder setDefaultString(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - defaultString_ = value; - onChanged(); - return this; - } - /** optional string default_string = 5; */ - public Builder clearDefaultString() { - - defaultString_ = getDefaultInstance().getDefaultString(); - onChanged(); - return this; - } - /** optional string default_string = 5; */ - public Builder setDefaultStringBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - defaultString_ = value; - onChanged(); - return this; - } - - private boolean defaultBool_; - /** optional bool default_bool = 6; */ - public boolean getDefaultBool() { - return defaultBool_; - } - /** optional bool default_bool = 6; */ - public Builder setDefaultBool(boolean value) { - - defaultBool_ = value; - onChanged(); - return this; - } - /** optional bool default_bool = 6; */ - public Builder clearDefaultBool() { - - defaultBool_ = false; - onChanged(); - return this; - } - - private float defaultFloat_; - /** optional float default_float = 7; */ - public float getDefaultFloat() { - return defaultFloat_; - } - /** optional float default_float = 7; */ - public Builder setDefaultFloat(float value) { - - defaultFloat_ = value; - onChanged(); - return this; - } - /** optional float default_float = 7; */ - public Builder clearDefaultFloat() { - - defaultFloat_ = 0F; - onChanged(); - return this; - } - - private double defaultDouble_; - /** optional double default_double = 8; */ - public double getDefaultDouble() { - return defaultDouble_; - } - /** optional double default_double = 8; */ - public Builder setDefaultDouble(double value) { - - defaultDouble_ = value; - onChanged(); - return this; - } - /** optional double default_double = 8; */ - public Builder clearDefaultDouble() { - - defaultDouble_ = 0D; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString defaultBytes_ = com.google.protobuf.ByteString.EMPTY; - /** optional bytes default_bytes = 9; */ - public com.google.protobuf.ByteString getDefaultBytes() { - return defaultBytes_; - } - /** optional bytes default_bytes = 9; */ - public Builder setDefaultBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - defaultBytes_ = value; - onChanged(); - return this; - } - /** optional bytes default_bytes = 9; */ - public Builder clearDefaultBytes() { - - defaultBytes_ = getDefaultInstance().getDefaultBytes(); - onChanged(); - return this; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:com.google.protobuf.jruby.Sentinel) - } - - // @@protoc_insertion_point(class_scope:com.google.protobuf.jruby.Sentinel) - private static final com.google.protobuf.jruby.SentinelOuterClass.Sentinel defaultInstance; - - static { - defaultInstance = new com.google.protobuf.jruby.SentinelOuterClass.Sentinel(); - } - - public static com.google.protobuf.jruby.SentinelOuterClass.Sentinel getDefaultInstance() { - return defaultInstance; - } - - public com.google.protobuf.jruby.SentinelOuterClass.Sentinel getDefaultInstanceForType() { - return defaultInstance; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_google_protobuf_jruby_Sentinel_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_google_protobuf_jruby_Sentinel_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n\016sentinel.proto\022\031com.google.protobuf.jr" - + "uby\"\334\001\n\010Sentinel\022\025\n\rdefault_int32\030\001 \001(\005\022" - + "\025\n\rdefault_int64\030\002 \001(\003\022\026\n\016default_unit32" - + "\030\003 \001(\r\022\026\n\016default_uint64\030\004 \001(\004\022\026\n\016defaul" - + "t_string\030\005 \001(\t\022\024\n\014default_bool\030\006 \001(\010\022\025\n\r" - + "default_float\030\007 \001(\002\022\026\n\016default_double\030\010 " - + "\001(\001\022\025\n\rdefault_bytes\030\t \001(\014B\002H\002b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_com_google_protobuf_jruby_Sentinel_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_com_google_protobuf_jruby_Sentinel_fieldAccessorTable = - new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_google_protobuf_jruby_Sentinel_descriptor, - new java.lang.String[] { - "DefaultInt32", - "DefaultInt64", - "DefaultUnit32", - "DefaultUint64", - "DefaultString", - "DefaultBool", - "DefaultFloat", - "DefaultDouble", - "DefaultBytes", - }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/ruby/src/main/java/sentinel.proto b/ruby/src/main/java/sentinel.proto deleted file mode 100644 index f9d5e1551e6f..000000000000 --- a/ruby/src/main/java/sentinel.proto +++ /dev/null @@ -1,24 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto3"; - -package com.google.protobuf.jruby; - -option optimize_for = CODE_SIZE; - -message Sentinel { - int32 default_int32 = 1; - int64 default_int64 = 2; - uint32 default_unit32 = 3; - uint64 default_uint64 = 4; - string default_string = 5; - bool default_bool = 6; - float default_float = 7; - double default_double = 8; - bytes default_bytes = 9; -}