Skip to content

Commit

Permalink
internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 625554775
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Apr 23, 2024
1 parent b618f67 commit f09c3c0
Show file tree
Hide file tree
Showing 4 changed files with 2,031 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/google/protobuf/compiler/java/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ inline bool CheckUtf8(const FieldDescriptor* descriptor) {
descriptor->file()->options().java_string_check_utf8();
}


void WriteUInt32ToUtf16CharSequence(uint32_t number,
std::vector<uint16_t>* output);

Expand Down
8 changes: 8 additions & 0 deletions src/google/protobuf/compiler/java/immutable/enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@

#include "google/protobuf/compiler/java/immutable/enum.h"

#include <algorithm>
#include <cmath>
#include <string>
#include <vector>

#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"
Expand All @@ -30,6 +36,7 @@ namespace protobuf {
namespace compiler {
namespace java {


EnumNonLiteGenerator::EnumNonLiteGenerator(const EnumDescriptor* descriptor,
bool immutable_api, Context* context)
: descriptor_(descriptor),
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/google/protobuf/compiler/java/immutable/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class EnumNonLiteGenerator : public EnumGenerator {
ClassNameResolver* name_resolver_;

bool CanUseEnumValues();

};

} // namespace java
Expand Down
Loading

0 comments on commit f09c3c0

Please sign in to comment.