Skip to content

Commit

Permalink
compiler: support proto3 field presence for codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
dapengzhang0 committed May 21, 2020
1 parent cef914c commit 0c6e090
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/src/java_plugin/cpp/java_plugin.cpp
Expand Up @@ -43,10 +43,14 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
JavaGrpcGenerator() {}
virtual ~JavaGrpcGenerator() {}

uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
}

virtual bool Generate(const google::protobuf::FileDescriptor* file,
const std::string& parameter,
google::protobuf::compiler::GeneratorContext* context,
std::string* error) const {
std::string* error) const override {
std::vector<std::pair<std::string, std::string> > options;
google::protobuf::compiler::ParseGeneratorParameter(parameter, &options);

Expand Down

0 comments on commit 0c6e090

Please sign in to comment.