From d9a542b884e30c80449b61faa0c4610dbf2ae650 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 13 Dec 2024 15:24:14 -0800 Subject: [PATCH] Automated rollback of commit 100d54bc6b6a2786f2ddafed24c91c07e12c23a7. PiperOrigin-RevId: 706019093 --- src/google/protobuf/compiler/cpp/extension.cc | 11 +++-------- src/google/protobuf/unittest.proto | 7 ------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/extension.cc b/src/google/protobuf/compiler/cpp/extension.cc index aa14710328394..6dab8fdb96c47 100644 --- a/src/google/protobuf/compiler/cpp/extension.cc +++ b/src/google/protobuf/compiler/cpp/extension.cc @@ -69,12 +69,6 @@ ExtensionGenerator::ExtensionGenerator(const FieldDescriptor* descriptor, variables_["constant_name"] = FieldConstantName(descriptor_); variables_["field_type"] = absl::StrCat(static_cast(descriptor_->type())); - // Downgrade string to bytes if it is not UTF8 validated. - if (descriptor_->type() == FieldDescriptor::TYPE_STRING && - !descriptor_->requires_utf8_validation()) { - variables_["field_type"] = - absl::StrCat(static_cast(FieldDescriptor::TYPE_BYTES)); - } variables_["repeated"] = descriptor_->is_repeated() ? "true" : "false"; variables_["packed"] = descriptor_->is_packed() ? "true" : "false"; variables_["dllexport_decl"] = options.dllexport_decl; @@ -275,8 +269,9 @@ void ExtensionGenerator::GenerateRegistration(io::Printer* p, (::_pbi::ExtensionSet::ShouldRegisterAtThisTime( {{&$extendee_table$, $extendee_index$}}, $preregister$) ? ::_pbi::ExtensionSet::RegisterExtension( - ::_pbi::GetPrototypeForWeakDescriptor( - &$extendee_table$, $extendee_index$, true), + ::_pbi::GetPrototypeForWeakDescriptor(&$extendee_table$, + $extendee_index$, + true), $number$, $field_type$, $repeated$, $packed$) : (void)0), )cc"); diff --git a/src/google/protobuf/unittest.proto b/src/google/protobuf/unittest.proto index 8df24807d1631..7cdbcd28e4720 100644 --- a/src/google/protobuf/unittest.proto +++ b/src/google/protobuf/unittest.proto @@ -508,13 +508,6 @@ extend TestAllExtensions { TestAllTypes.NestedMessage oneof_nested_message_extension = 112; string oneof_string_extension = 113; bytes oneof_bytes_extension = 114; - - string optional_utf8_string_extension = 115 [ - features.utf8_validation = VERIFY - ]; - repeated string repeated_utf8_string_extension = 116 [ - features.utf8_validation = VERIFY - ]; } message OptionalGroup_extension {