diff --git a/src/google/protobuf/compiler/java/helpers.h b/src/google/protobuf/compiler/java/helpers.h index ed27eae1d5559..dd0782401f273 100644 --- a/src/google/protobuf/compiler/java/helpers.h +++ b/src/google/protobuf/compiler/java/helpers.h @@ -387,6 +387,7 @@ inline bool CheckUtf8(const FieldDescriptor* descriptor) { descriptor->file()->options().java_string_check_utf8(); } + void WriteUInt32ToUtf16CharSequence(uint32_t number, std::vector* output); diff --git a/src/google/protobuf/compiler/java/immutable/enum.cc b/src/google/protobuf/compiler/java/immutable/enum.cc index 61b307914cbfa..8a7db1610c4cd 100644 --- a/src/google/protobuf/compiler/java/immutable/enum.cc +++ b/src/google/protobuf/compiler/java/immutable/enum.cc @@ -11,10 +11,16 @@ #include "google/protobuf/compiler/java/immutable/enum.h" +#include +#include #include +#include #include "absl/container/flat_hash_map.h" #include "absl/strings/str_cat.h" +#include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/string_view.h" #include "google/protobuf/compiler/java/context.h" #include "google/protobuf/compiler/java/doc_comment.h" #include "google/protobuf/compiler/java/helpers.h" @@ -30,6 +36,7 @@ namespace protobuf { namespace compiler { namespace java { + EnumNonLiteGenerator::EnumNonLiteGenerator(const EnumDescriptor* descriptor, bool immutable_api, Context* context) : descriptor_(descriptor), @@ -374,6 +381,7 @@ void EnumNonLiteGenerator::Generate(io::Printer* printer) { printer->Print("}\n\n"); } + bool EnumNonLiteGenerator::CanUseEnumValues() { if (canonical_values_.size() != descriptor_->value_count()) { return false; diff --git a/src/google/protobuf/compiler/java/immutable/enum.h b/src/google/protobuf/compiler/java/immutable/enum.h index 18ccc01e953ab..8528d7f81f92d 100644 --- a/src/google/protobuf/compiler/java/immutable/enum.h +++ b/src/google/protobuf/compiler/java/immutable/enum.h @@ -71,6 +71,7 @@ class EnumNonLiteGenerator : public EnumGenerator { ClassNameResolver* name_resolver_; bool CanUseEnumValues(); + }; } // namespace java diff --git a/src/google/protobuf/large_enum.proto b/src/google/protobuf/large_enum.proto new file mode 100644 index 0000000000000..d7c154831ce25 --- /dev/null +++ b/src/google/protobuf/large_enum.proto @@ -0,0 +1,8 @@ +// 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 +// +// Sample message to generate large enum code.