Skip to content

Commit

Permalink
internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 663783805
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Aug 16, 2024
1 parent f69eb55 commit 3b4605e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/google/protobuf/compiler/java/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ cc_library(
"//src/google/protobuf:port",
"//src/google/protobuf/compiler:code_generator",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)

Expand Down
1 change: 0 additions & 1 deletion src/google/protobuf/compiler/java/full/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ cc_library(
"//src/google/protobuf/io:printer",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)

Expand Down
9 changes: 2 additions & 7 deletions src/google/protobuf/compiler/java/full/enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@

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

#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#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"
#include "google/protobuf/compiler/java/internal_helpers.h"
#include "google/protobuf/compiler/java/name_resolver.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"

Expand All @@ -37,7 +34,6 @@ namespace protobuf {
namespace compiler {
namespace java {


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

bool CanUseEnumValues();

};

} // namespace java
Expand Down
14 changes: 14 additions & 0 deletions src/google/protobuf/compiler/java/internal_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@

#include "google/protobuf/compiler/java/internal_helpers.h"

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

#include "absl/log/absl_log.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"
#include "google/protobuf/compiler/java/name_resolver.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"

// Must be last.
Expand Down Expand Up @@ -106,6 +119,7 @@ int GetExperimentalJavaFieldType(const FieldDescriptor* field) {
}
}


} // namespace java
} // namespace compiler
} // namespace protobuf
Expand Down
2 changes: 2 additions & 0 deletions src/google/protobuf/compiler/java/internal_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#define GOOGLE_PROTOBUF_COMPILER_JAVA_INTERNAL_HELPERS_H__

#include "google/protobuf/compiler/java/java_features.pb.h"
#include "google/protobuf/compiler/java/context.h"
#include "google/protobuf/compiler/java/generator.h"
#include "google/protobuf/compiler/java/name_resolver.h"
#include "google/protobuf/compiler/java/names.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
Expand Down
5 changes: 5 additions & 0 deletions src/google/protobuf/compiler/java/lite/enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
#include "google/protobuf/compiler/java/lite/enum.h"

#include <string>
#include <utility>
#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/java/context.h"
#include "google/protobuf/compiler/java/doc_comment.h"
#include "google/protobuf/compiler/java/helpers.h"
#include "google/protobuf/compiler/java/internal_helpers.h"
#include "google/protobuf/compiler/java/name_resolver.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
Expand Down Expand Up @@ -54,6 +57,8 @@ EnumLiteGenerator::~EnumLiteGenerator() {}
void EnumLiteGenerator::Generate(io::Printer* printer) {
WriteEnumDocComment(printer, descriptor_, context_->options());
MaybePrintGeneratedAnnotation(context_, printer, descriptor_, immutable_api_);


printer->Print(
"$deprecation$public enum $classname$\n"
" implements com.google.protobuf.Internal.EnumLite {\n",
Expand Down

0 comments on commit 3b4605e

Please sign in to comment.