Fixed two errors caused by incorrect merge of the rpc interface generator

pull/288/head
csharptest 14 years ago committed by rogerk
parent da4989c4ed
commit efed509b55
  1. 8
      src/ProtoGen/ServiceInterfaceGenerator.cs
  2. 4
      src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs

@ -216,8 +216,8 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine( writer.WriteLine(
"public TMessage CallMethod<TMessage, TBuilder>(string methodName, pb::IMessageLite request, pb::IBuilderLite<TMessage, TBuilder> response)"); "public TMessage CallMethod<TMessage, TBuilder>(string methodName, pb::IMessageLite request, pb::IBuilderLite<TMessage, TBuilder> response)");
writer.WriteLine(" where TMessage : IMessageLite<TMessage, TBuilder>"); writer.WriteLine(" where TMessage : pb::IMessageLite<TMessage, TBuilder>");
writer.WriteLine(" where TBuilder : IBuilderLite<TMessage, TBuilder> {"); writer.WriteLine(" where TBuilder : pb::IBuilderLite<TMessage, TBuilder> {");
writer.Indent(); writer.Indent();
writer.WriteLine("switch(methodName) {"); writer.WriteLine("switch(methodName) {");
writer.Indent(); writer.Indent();
@ -230,7 +230,7 @@ namespace Google.ProtocolBuffers.ProtoGen
GetClassName(method.InputType)); GetClassName(method.InputType));
} }
writer.WriteLine( writer.WriteLine(
"default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);"); "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);", Descriptor.Name);
writer.Outdent(); writer.Outdent();
writer.WriteLine("}"); //end switch writer.WriteLine("}"); //end switch
writer.Outdent(); writer.Outdent();
@ -287,7 +287,7 @@ namespace Google.ProtocolBuffers.ProtoGen
method.Name, GetClassName(method.InputType), GetClassName(method.OutputType)); method.Name, GetClassName(method.InputType), GetClassName(method.OutputType));
} }
writer.WriteLine( writer.WriteLine(
"default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);"); "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);", Descriptor.Name);
writer.Outdent(); writer.Outdent();
writer.WriteLine("}"); //end switch writer.WriteLine("}"); //end switch
writer.Outdent(); writer.Outdent();

@ -1208,8 +1208,8 @@ namespace Google.ProtocolBuffers.TestProtos {
} }
public TMessage CallMethod<TMessage, TBuilder>(string methodName, pb::IMessageLite request, pb::IBuilderLite<TMessage, TBuilder> response) public TMessage CallMethod<TMessage, TBuilder>(string methodName, pb::IMessageLite request, pb::IBuilderLite<TMessage, TBuilder> response)
where TMessage : IMessageLite<TMessage, TBuilder> where TMessage : pb::IMessageLite<TMessage, TBuilder>
where TBuilder : IBuilderLite<TMessage, TBuilder> { where TBuilder : pb::IBuilderLite<TMessage, TBuilder> {
switch(methodName) { switch(methodName) {
case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build(); case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build();
case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build(); case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build();

Loading…
Cancel
Save