Commit 2273ee40 authored by liujisi@google.com's avatar liujisi@google.com

Add java options to plugin proto and rollback the r450

parent 0c995c93
...@@ -857,14 +857,12 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) { ...@@ -857,14 +857,12 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) {
void MessageGenerator:: void MessageGenerator::
GenerateShutdownCode(io::Printer* printer) { GenerateShutdownCode(io::Printer* printer) {
printer->Print( printer->Print(
"delete $classname$::default_instance_;\n" "delete $classname$::default_instance_;\n",
"$classname$::default_instance_ = NULL;\n",
"classname", classname_); "classname", classname_);
if (HasDescriptorMethods(descriptor_->file())) { if (HasDescriptorMethods(descriptor_->file())) {
printer->Print( printer->Print(
"delete $classname$_reflection_;\n" "delete $classname$_reflection_;\n",
"$classname$_reflection_ = NULL;\n",
"classname", classname_); "classname", classname_);
} }
......
...@@ -251,8 +251,7 @@ void StringFieldGenerator:: ...@@ -251,8 +251,7 @@ void StringFieldGenerator::
GenerateShutdownCode(io::Printer* printer) const { GenerateShutdownCode(io::Printer* printer) const {
if (!descriptor_->default_value_string().empty()) { if (!descriptor_->default_value_string().empty()) {
printer->Print(variables_, printer->Print(variables_,
"delete $classname$::$default_variable$;\n" "delete $classname$::$default_variable$;\n");
"$classname$::$default_variable$ = NULL;\n");
} }
} }
......
...@@ -115,17 +115,11 @@ void protobuf_RegisterTypes(const ::std::string&) { ...@@ -115,17 +115,11 @@ void protobuf_RegisterTypes(const ::std::string&) {
void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
delete CodeGeneratorRequest::default_instance_; delete CodeGeneratorRequest::default_instance_;
CodeGeneratorRequest::default_instance_ = NULL;
delete CodeGeneratorRequest_reflection_; delete CodeGeneratorRequest_reflection_;
CodeGeneratorRequest_reflection_ = NULL;
delete CodeGeneratorResponse::default_instance_; delete CodeGeneratorResponse::default_instance_;
CodeGeneratorResponse::default_instance_ = NULL;
delete CodeGeneratorResponse_reflection_; delete CodeGeneratorResponse_reflection_;
CodeGeneratorResponse_reflection_ = NULL;
delete CodeGeneratorResponse_File::default_instance_; delete CodeGeneratorResponse_File::default_instance_;
CodeGeneratorResponse_File::default_instance_ = NULL;
delete CodeGeneratorResponse_File_reflection_; delete CodeGeneratorResponse_File_reflection_;
CodeGeneratorResponse_File_reflection_ = NULL;
} }
void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
...@@ -145,7 +139,9 @@ void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { ...@@ -145,7 +139,9 @@ void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
"atorResponse\022\r\n\005error\030\001 \001(\t\022B\n\004file\030\017 \003(" "atorResponse\022\r\n\005error\030\001 \001(\t\022B\n\004file\030\017 \003("
"\01324.google.protobuf.compiler.CodeGenerat" "\01324.google.protobuf.compiler.CodeGenerat"
"orResponse.File\032>\n\004File\022\014\n\004name\030\001 \001(\t\022\027\n" "orResponse.File\032>\n\004File\022\014\n\004name\030\001 \001(\t\022\027\n"
"\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(\t", 399); "\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(\tB"
",\n\034com.google.protobuf.compilerB\014PluginP"
"rotos", 445);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes); "google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes);
CodeGeneratorRequest::default_instance_ = new CodeGeneratorRequest(); CodeGeneratorRequest::default_instance_ = new CodeGeneratorRequest();
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
// flag "--${NAME}_out" is passed to protoc. // flag "--${NAME}_out" is passed to protoc.
package google.protobuf.compiler; package google.protobuf.compiler;
option java_package = "com.google.protobuf.compiler";
option java_outer_classname = "PluginProtos";
import "google/protobuf/descriptor.proto"; import "google/protobuf/descriptor.proto";
......
...@@ -518,85 +518,45 @@ void protobuf_RegisterTypes(const ::std::string&) { ...@@ -518,85 +518,45 @@ void protobuf_RegisterTypes(const ::std::string&) {
void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() { void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() {
delete FileDescriptorSet::default_instance_; delete FileDescriptorSet::default_instance_;
FileDescriptorSet::default_instance_ = NULL;
delete FileDescriptorSet_reflection_; delete FileDescriptorSet_reflection_;
FileDescriptorSet_reflection_ = NULL;
delete FileDescriptorProto::default_instance_; delete FileDescriptorProto::default_instance_;
FileDescriptorProto::default_instance_ = NULL;
delete FileDescriptorProto_reflection_; delete FileDescriptorProto_reflection_;
FileDescriptorProto_reflection_ = NULL;
delete DescriptorProto::default_instance_; delete DescriptorProto::default_instance_;
DescriptorProto::default_instance_ = NULL;
delete DescriptorProto_reflection_; delete DescriptorProto_reflection_;
DescriptorProto_reflection_ = NULL;
delete DescriptorProto_ExtensionRange::default_instance_; delete DescriptorProto_ExtensionRange::default_instance_;
DescriptorProto_ExtensionRange::default_instance_ = NULL;
delete DescriptorProto_ExtensionRange_reflection_; delete DescriptorProto_ExtensionRange_reflection_;
DescriptorProto_ExtensionRange_reflection_ = NULL;
delete FieldDescriptorProto::default_instance_; delete FieldDescriptorProto::default_instance_;
FieldDescriptorProto::default_instance_ = NULL;
delete FieldDescriptorProto_reflection_; delete FieldDescriptorProto_reflection_;
FieldDescriptorProto_reflection_ = NULL;
delete EnumDescriptorProto::default_instance_; delete EnumDescriptorProto::default_instance_;
EnumDescriptorProto::default_instance_ = NULL;
delete EnumDescriptorProto_reflection_; delete EnumDescriptorProto_reflection_;
EnumDescriptorProto_reflection_ = NULL;
delete EnumValueDescriptorProto::default_instance_; delete EnumValueDescriptorProto::default_instance_;
EnumValueDescriptorProto::default_instance_ = NULL;
delete EnumValueDescriptorProto_reflection_; delete EnumValueDescriptorProto_reflection_;
EnumValueDescriptorProto_reflection_ = NULL;
delete ServiceDescriptorProto::default_instance_; delete ServiceDescriptorProto::default_instance_;
ServiceDescriptorProto::default_instance_ = NULL;
delete ServiceDescriptorProto_reflection_; delete ServiceDescriptorProto_reflection_;
ServiceDescriptorProto_reflection_ = NULL;
delete MethodDescriptorProto::default_instance_; delete MethodDescriptorProto::default_instance_;
MethodDescriptorProto::default_instance_ = NULL;
delete MethodDescriptorProto_reflection_; delete MethodDescriptorProto_reflection_;
MethodDescriptorProto_reflection_ = NULL;
delete FileOptions::default_instance_; delete FileOptions::default_instance_;
FileOptions::default_instance_ = NULL;
delete FileOptions_reflection_; delete FileOptions_reflection_;
FileOptions_reflection_ = NULL;
delete MessageOptions::default_instance_; delete MessageOptions::default_instance_;
MessageOptions::default_instance_ = NULL;
delete MessageOptions_reflection_; delete MessageOptions_reflection_;
MessageOptions_reflection_ = NULL;
delete FieldOptions::default_instance_; delete FieldOptions::default_instance_;
FieldOptions::default_instance_ = NULL;
delete FieldOptions_reflection_; delete FieldOptions_reflection_;
FieldOptions_reflection_ = NULL;
delete EnumOptions::default_instance_; delete EnumOptions::default_instance_;
EnumOptions::default_instance_ = NULL;
delete EnumOptions_reflection_; delete EnumOptions_reflection_;
EnumOptions_reflection_ = NULL;
delete EnumValueOptions::default_instance_; delete EnumValueOptions::default_instance_;
EnumValueOptions::default_instance_ = NULL;
delete EnumValueOptions_reflection_; delete EnumValueOptions_reflection_;
EnumValueOptions_reflection_ = NULL;
delete ServiceOptions::default_instance_; delete ServiceOptions::default_instance_;
ServiceOptions::default_instance_ = NULL;
delete ServiceOptions_reflection_; delete ServiceOptions_reflection_;
ServiceOptions_reflection_ = NULL;
delete MethodOptions::default_instance_; delete MethodOptions::default_instance_;
MethodOptions::default_instance_ = NULL;
delete MethodOptions_reflection_; delete MethodOptions_reflection_;
MethodOptions_reflection_ = NULL;
delete UninterpretedOption::default_instance_; delete UninterpretedOption::default_instance_;
UninterpretedOption::default_instance_ = NULL;
delete UninterpretedOption_reflection_; delete UninterpretedOption_reflection_;
UninterpretedOption_reflection_ = NULL;
delete UninterpretedOption_NamePart::default_instance_; delete UninterpretedOption_NamePart::default_instance_;
UninterpretedOption_NamePart::default_instance_ = NULL;
delete UninterpretedOption_NamePart_reflection_; delete UninterpretedOption_NamePart_reflection_;
UninterpretedOption_NamePart_reflection_ = NULL;
delete SourceCodeInfo::default_instance_; delete SourceCodeInfo::default_instance_;
SourceCodeInfo::default_instance_ = NULL;
delete SourceCodeInfo_reflection_; delete SourceCodeInfo_reflection_;
SourceCodeInfo_reflection_ = NULL;
delete SourceCodeInfo_Location::default_instance_; delete SourceCodeInfo_Location::default_instance_;
SourceCodeInfo_Location::default_instance_ = NULL;
delete SourceCodeInfo_Location_reflection_; delete SourceCodeInfo_Location_reflection_;
SourceCodeInfo_Location_reflection_ = NULL;
} }
void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment