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 330cbf3592c..a8ed0e8d915 100644 --- a/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/java/core/src/main/java/com/google/protobuf/Descriptors.java @@ -140,8 +140,6 @@ public List getPublicDependencies() { } /** The syntax of the .proto file. */ - @Deprecated - public enum Syntax { UNKNOWN("unknown"), PROTO2("proto2"), @@ -156,8 +154,6 @@ enum Syntax { } /** Get the syntax of the .proto file. */ - @Deprecated - public Syntax getSyntax() { if (Syntax.PROTO3.name.equals(proto.getSyntax())) { return Syntax.PROTO3; @@ -1273,8 +1269,6 @@ public OneofDescriptor getRealContainingOneof() { * Returns true if this field was syntactically written with "optional" in the .proto file. * Excludes singular proto3 fields that do not have a label. */ - @Deprecated - public boolean hasOptionalKeyword() { return isProto3Optional || (file.getSyntax() == Syntax.PROTO2 && isOptional() && getContainingOneof() == null); @@ -2843,8 +2837,6 @@ public OneofDescriptorProto toProto() { return proto; } - @Deprecated - public boolean isSynthetic() { return fields.length == 1 && fields[0].isProto3Optional; } diff --git a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java index 12e609191d2..ec57a4bff2b 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java @@ -42,6 +42,7 @@ import com.google.protobuf.DynamicMessage; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.LegacyDescriptorsUtil.LegacyFileDescriptor; +import com.google.protobuf.LegacyDescriptorsUtil.LegacyOneofDescriptor; import com.google.protobuf.Message; import com.google.protobuf.UnknownFieldSet; import com.google.protobuf.util.JsonFormat; @@ -1340,7 +1341,7 @@ private IRubyObject setFieldInternal( // Keep track of what Oneofs are set if (value.isNil()) { oneofCases.remove(oneofDescriptor); - if (!oneofDescriptor.isSynthetic()) { + if (!LegacyOneofDescriptor.isSynthetic(oneofDescriptor)) { addValue = false; } } else {