Commit c9bce45a authored by csharptest's avatar csharptest Committed by rogerk

Portability Changes -

Removing uses of Enum to IConvertible from CodedIOStreams,
Removed MessageStreamIterator.FromFile on non-client profiles,
Removed use of Path.GetFileName,
Removed uses of Converter<T1, T2> delegate,
Removed Guid/DispId options from test protos
parent 9f787cc6
...@@ -27,8 +27,15 @@ message RefineSearchRequest { ...@@ -27,8 +27,15 @@ message RefineSearchRequest {
} }
service SearchService { service SearchService {
/*
Add this option to specify the GuidAttribute on the service interface
option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}";
rpc Search (SearchRequest) returns (SearchResponse) { option (google.protobuf.csharp_method_options).dispatch_id = 5; }; */
rpc Search (SearchRequest) returns (SearchResponse)
/*
Add this option to specify the DispIdAttribute on the service interface
{ option (google.protobuf.csharp_method_options).dispatch_id = 5; }
*/ ;
rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); rpc RefineSearch (RefineSearchRequest) returns (SearchResponse);
} }
...@@ -28,8 +28,15 @@ message RefineSearchRequest { ...@@ -28,8 +28,15 @@ message RefineSearchRequest {
} }
service SearchService { service SearchService {
/*
Add this option to specify the GuidAttribute on the service interface
option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}";
rpc Search (SearchRequest) returns (SearchResponse) { option (google.protobuf.csharp_method_options).dispatch_id = 5; }; */
rpc Search (SearchRequest) returns (SearchResponse)
/*
Add this option to specify the DispIdAttribute on the service interface
{ option (google.protobuf.csharp_method_options).dispatch_id = 5; }
*/ ;
rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); rpc RefineSearch (RefineSearchRequest) returns (SearchResponse);
} }
...@@ -78,7 +78,7 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -78,7 +78,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
{ {
contentType = (contentType ?? String.Empty).Split(';')[0].Trim(); contentType = (contentType ?? String.Empty).Split(';')[0].Trim();
Converter<Stream, ICodedInputStream> factory; CodedInputBuilder factory;
if(!options.MimeInputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null) if(!options.MimeInputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null)
{ {
if(String.IsNullOrEmpty(options.DefaultContentType) || if(String.IsNullOrEmpty(options.DefaultContentType) ||
...@@ -95,7 +95,7 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -95,7 +95,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
{ {
contentType = (contentType ?? String.Empty).Split(';')[0].Trim(); contentType = (contentType ?? String.Empty).Split(';')[0].Trim();
Converter<Stream, ICodedOutputStream> factory; CodedOutputBuilder factory;
if (!options.MimeOutputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null) if (!options.MimeOutputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null)
{ {
if (String.IsNullOrEmpty(options.DefaultContentType) || if (String.IsNullOrEmpty(options.DefaultContentType) ||
......
...@@ -5,6 +5,15 @@ using Google.ProtocolBuffers.Collections; ...@@ -5,6 +5,15 @@ using Google.ProtocolBuffers.Collections;
namespace Google.ProtocolBuffers.Serialization.Http namespace Google.ProtocolBuffers.Serialization.Http
{ {
/// <summary>
/// A delegate used to specify a method that constructs an ICodedInputStream from a .NET Stream.
/// </summary>
public delegate ICodedInputStream CodedInputBuilder(Stream stream);
/// <summary>
/// A delegate used to specify a method that constructs an ICodedOutputStream from a .NET Stream.
/// </summary>
public delegate ICodedOutputStream CodedOutputBuilder(Stream stream);
/// <summary> /// <summary>
/// Defines control information for the various formatting used with HTTP services /// Defines control information for the various formatting used with HTTP services
/// </summary> /// </summary>
...@@ -32,9 +41,9 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -32,9 +41,9 @@ namespace Google.ProtocolBuffers.Serialization.Http
/// <summary> /// <summary>
/// Default mime-type handling for input /// Default mime-type handling for input
/// </summary> /// </summary>
private static readonly IDictionary<string, Converter<Stream, ICodedInputStream>> MimeInputDefaults = private static readonly IDictionary<string, CodedInputBuilder> MimeInputDefaults =
new ReadOnlyDictionary<string, Converter<Stream, ICodedInputStream>>( new ReadOnlyDictionary<string, CodedInputBuilder>(
new Dictionary<string, Converter<Stream, ICodedInputStream>>(StringComparer.OrdinalIgnoreCase) new Dictionary<string, CodedInputBuilder>(StringComparer.OrdinalIgnoreCase)
{ {
{"application/json", JsonFormatReader.CreateInstance}, {"application/json", JsonFormatReader.CreateInstance},
{"application/x-json", JsonFormatReader.CreateInstance}, {"application/x-json", JsonFormatReader.CreateInstance},
...@@ -55,9 +64,9 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -55,9 +64,9 @@ namespace Google.ProtocolBuffers.Serialization.Http
/// <summary> /// <summary>
/// Default mime-type handling for output /// Default mime-type handling for output
/// </summary> /// </summary>
private static readonly IDictionary<string, Converter<Stream, ICodedOutputStream>> MimeOutputDefaults = private static readonly IDictionary<string, CodedOutputBuilder> MimeOutputDefaults =
new ReadOnlyDictionary<string, Converter<Stream, ICodedOutputStream>>( new ReadOnlyDictionary<string, CodedOutputBuilder>(
new Dictionary<string, Converter<Stream, ICodedOutputStream>>(StringComparer.OrdinalIgnoreCase) new Dictionary<string, CodedOutputBuilder>(StringComparer.OrdinalIgnoreCase)
{ {
{"application/json", JsonFormatWriter.CreateInstance}, {"application/json", JsonFormatWriter.CreateInstance},
{"application/x-json", JsonFormatWriter.CreateInstance}, {"application/x-json", JsonFormatWriter.CreateInstance},
...@@ -81,35 +90,35 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -81,35 +90,35 @@ namespace Google.ProtocolBuffers.Serialization.Http
private string _xmlReaderRootElementName; private string _xmlReaderRootElementName;
private string _xmlWriterRootElementName; private string _xmlWriterRootElementName;
private ExtensionRegistry _extensionRegistry; private ExtensionRegistry _extensionRegistry;
private Dictionary<string, Converter<Stream, ICodedInputStream>> _mimeInputTypes; private Dictionary<string, CodedInputBuilder> _mimeInputTypes;
private Dictionary<string, Converter<Stream, ICodedOutputStream>> _mimeOutputTypes; private Dictionary<string, CodedOutputBuilder> _mimeOutputTypes;
/// <summary> Provides access to modify the mime-type input stream construction </summary> /// <summary> Provides access to modify the mime-type input stream construction </summary>
public IDictionary<string, Converter<Stream, ICodedInputStream>> MimeInputTypes public IDictionary<string, CodedInputBuilder> MimeInputTypes
{ {
get get
{ {
return _mimeInputTypes ?? return _mimeInputTypes ??
(_mimeInputTypes = new Dictionary<string, Converter<Stream, ICodedInputStream>>( (_mimeInputTypes = new Dictionary<string, CodedInputBuilder>(
MimeInputDefaults, StringComparer.OrdinalIgnoreCase)); MimeInputDefaults, StringComparer.OrdinalIgnoreCase));
} }
} }
/// <summary> Provides access to modify the mime-type input stream construction </summary> /// <summary> Provides access to modify the mime-type input stream construction </summary>
public IDictionary<string, Converter<Stream, ICodedOutputStream>> MimeOutputTypes public IDictionary<string, CodedOutputBuilder> MimeOutputTypes
{ {
get get
{ {
return _mimeOutputTypes ?? return _mimeOutputTypes ??
(_mimeOutputTypes = new Dictionary<string, Converter<Stream, ICodedOutputStream>>( (_mimeOutputTypes = new Dictionary<string, CodedOutputBuilder>(
MimeOutputDefaults, StringComparer.OrdinalIgnoreCase)); MimeOutputDefaults, StringComparer.OrdinalIgnoreCase));
} }
} }
internal IDictionary<string, Converter<Stream, ICodedInputStream>> MimeInputTypesReadOnly internal IDictionary<string, CodedInputBuilder> MimeInputTypesReadOnly
{ get { return _mimeInputTypes ?? MimeInputDefaults; } } { get { return _mimeInputTypes ?? MimeInputDefaults; } }
internal IDictionary<string, Converter<Stream, ICodedOutputStream>> MimeOutputTypesReadOnly internal IDictionary<string, CodedOutputBuilder> MimeOutputTypesReadOnly
{ get { return _mimeOutputTypes ?? MimeOutputDefaults; } } { get { return _mimeOutputTypes ?? MimeOutputDefaults; } }
/// <summary> /// <summary>
......
...@@ -10,7 +10,7 @@ namespace Google.ProtocolBuffers ...@@ -10,7 +10,7 @@ namespace Google.ProtocolBuffers
[TestClass] [TestClass]
public class DeprecatedMemberTest public class DeprecatedMemberTest
{ {
private static void AssertIsDeprecated(ICustomAttributeProvider member) private static void AssertIsDeprecated(MemberInfo member)
{ {
Assert.IsNotNull(member); Assert.IsNotNull(member);
Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member);
......
...@@ -54,7 +54,9 @@ namespace Google.ProtocolBuffers ...@@ -54,7 +54,9 @@ namespace Google.ProtocolBuffers
b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator<ForeignEnum>(ForeignEnum.FOREIGN_BAR)); b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator<ForeignEnum>(ForeignEnum.FOREIGN_BAR));
} }
private static void AssertThrows<T>(System.Threading.ThreadStart method) where T : Exception private delegate void TestMethod();
private static void AssertThrows<T>(TestMethod method) where T : Exception
{ {
try try
{ {
......
...@@ -39,12 +39,11 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -39,12 +39,11 @@ namespace Google.ProtocolBuffers.TestProtos {
"dHMYASADKAsyGi5TZWFyY2hSZXNwb25zZS5SZXN1bHRJdGVtGicKClJlc3Vs" + "dHMYASADKAsyGi5TZWFyY2hSZXNwb25zZS5SZXN1bHRJdGVtGicKClJlc3Vs" +
"dEl0ZW0SCwoDdXJsGAEgAigJEgwKBG5hbWUYAiABKAkiUgoTUmVmaW5lU2Vh" + "dEl0ZW0SCwoDdXJsGAEgAigJEgwKBG5hbWUYAiABKAkiUgoTUmVmaW5lU2Vh" +
"cmNoUmVxdWVzdBIQCghDcml0ZXJpYRgBIAMoCRIpChBwcmV2aW91c19yZXN1" + "cmNoUmVxdWVzdBIQCghDcml0ZXJpYRgBIAMoCRIpChBwcmV2aW91c19yZXN1" +
"bHRzGAIgAigLMg8uU2VhcmNoUmVzcG9uc2UypQEKDVNlYXJjaFNlcnZpY2US" + "bHRzGAIgAigLMg8uU2VhcmNoUmVzcG9uc2UycQoNU2VhcmNoU2VydmljZRIp" +
"MAoGU2VhcmNoEg4uU2VhcmNoUmVxdWVzdBoPLlNlYXJjaFJlc3BvbnNlIgXC" + "CgZTZWFyY2gSDi5TZWFyY2hSZXF1ZXN0Gg8uU2VhcmNoUmVzcG9uc2USNQoM" +
"PgIIBRI1CgxSZWZpbmVTZWFyY2gSFC5SZWZpbmVTZWFyY2hSZXF1ZXN0Gg8u" + "UmVmaW5lU2VhcmNoEhQuUmVmaW5lU2VhcmNoUmVxdWVzdBoPLlNlYXJjaFJl" +
"U2VhcmNoUmVzcG9uc2UaK8I+KAome0E2NUYwOTI1LUZEMTEtNGY5NC1CMTY2" + "c3BvbnNlQj9IAcI+OgohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJv" +
"LTg5QUM0RjAyNzIwNX1CP0gBwj46CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJz" + "dG9zEhJVbml0VGVzdFJwY0ludGVyb3CIDgM=");
"LlRlc3RQcm90b3MSElVuaXRUZXN0UnBjSW50ZXJvcIgOAw==");
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
descriptor = root; descriptor = root;
internal__static_SearchRequest__Descriptor = Descriptor.MessageTypes[0]; internal__static_SearchRequest__Descriptor = Descriptor.MessageTypes[0];
...@@ -1352,9 +1351,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1352,9 +1351,7 @@ namespace Google.ProtocolBuffers.TestProtos {
#endregion #endregion
#region Services #region Services
[global::System.Runtime.InteropServices.GuidAttribute("a65f0925-fd11-4f94-b166-89ac4f027205")]
public partial interface ISearchService { public partial interface ISearchService {
[global::System.Runtime.InteropServices.DispId(5)]
global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest); global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest);
global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest); global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest);
} }
......
...@@ -449,7 +449,7 @@ namespace Google.ProtocolBuffers ...@@ -449,7 +449,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
[CLSCompliant(false)] [CLSCompliant(false)]
public bool ReadEnum<T>(ref T value, out object unknown) public bool ReadEnum<T>(ref T value, out object unknown)
where T : struct, IComparable, IFormattable, IConvertible where T : struct, IComparable, IFormattable
{ {
int number = (int) ReadRawVarint32(); int number = (int) ReadRawVarint32();
if (Enum.IsDefined(typeof(T), number)) if (Enum.IsDefined(typeof(T), number))
...@@ -882,7 +882,7 @@ namespace Google.ProtocolBuffers ...@@ -882,7 +882,7 @@ namespace Google.ProtocolBuffers
[CLSCompliant(false)] [CLSCompliant(false)]
public void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list, public void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list,
out ICollection<object> unknown) out ICollection<object> unknown)
where T : struct, IComparable, IFormattable, IConvertible where T : struct, IComparable, IFormattable
{ {
unknown = null; unknown = null;
object unkval; object unkval;
......
...@@ -575,7 +575,7 @@ namespace Google.ProtocolBuffers ...@@ -575,7 +575,7 @@ namespace Google.ProtocolBuffers
case FieldType.Enum: case FieldType.Enum:
if (value is Enum) if (value is Enum)
{ {
return ComputeEnumSize(fieldNumber, ((IConvertible)value).ToInt32(FrameworkPortability.InvariantCulture)); return ComputeEnumSize(fieldNumber, Convert.ToInt32(value));
} }
else else
{ {
...@@ -631,7 +631,7 @@ namespace Google.ProtocolBuffers ...@@ -631,7 +631,7 @@ namespace Google.ProtocolBuffers
case FieldType.Enum: case FieldType.Enum:
if (value is Enum) if (value is Enum)
{ {
return ComputeEnumSizeNoTag(((IConvertible)value).ToInt32(FrameworkPortability.InvariantCulture)); return ComputeEnumSizeNoTag(Convert.ToInt32(value));
} }
else else
{ {
......
...@@ -806,7 +806,7 @@ namespace Google.ProtocolBuffers ...@@ -806,7 +806,7 @@ namespace Google.ProtocolBuffers
[CLSCompliant(false)] [CLSCompliant(false)]
public void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list) public void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
where T : struct, IComparable, IFormattable, IConvertible where T : struct, IComparable, IFormattable
{ {
if (list is ICastArray) if (list is ICastArray)
{ {
...@@ -1028,7 +1028,7 @@ namespace Google.ProtocolBuffers ...@@ -1028,7 +1028,7 @@ namespace Google.ProtocolBuffers
[CLSCompliant(false)] [CLSCompliant(false)]
public void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list) public void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
where T : struct, IComparable, IFormattable, IConvertible where T : struct, IComparable, IFormattable
{ {
WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);
WriteRawVarint32((uint) calculatedSize); WriteRawVarint32((uint) calculatedSize);
......
...@@ -90,12 +90,14 @@ namespace Google.ProtocolBuffers.Descriptors ...@@ -90,12 +90,14 @@ namespace Google.ProtocolBuffers.Descriptors
csharpFileOptions = BuildOrFakeWithDefaultOptions(options); csharpFileOptions = BuildOrFakeWithDefaultOptions(options);
} }
static readonly char[] PathSeperators = new char[] { '/', '\\' };
private CSharpFileOptions BuildOrFakeWithDefaultOptions(CSharpFileOptions defaultOptions) private CSharpFileOptions BuildOrFakeWithDefaultOptions(CSharpFileOptions defaultOptions)
{ {
// Fix for being able to relocate these files to any directory structure // Fix for being able to relocate these files to any directory structure
if (proto.Package == "google.protobuf") if (proto.Package == "google.protobuf")
{ {
string filename = Path.GetFileName(proto.Name); int ixslash = proto.Name.LastIndexOfAny(PathSeperators);
string filename = ixslash < 0 ? proto.Name : proto.Name.Substring(ixslash + 1);
// TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues) // TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues)
if (filename == "descriptor.proto") if (filename == "descriptor.proto")
{ {
......
...@@ -171,7 +171,7 @@ namespace Google.ProtocolBuffers ...@@ -171,7 +171,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
[CLSCompliant(false)] [CLSCompliant(false)]
bool ReadEnum<T>(ref T value, out object unknown) bool ReadEnum<T>(ref T value, out object unknown)
where T : struct, IComparable, IFormattable, IConvertible; where T : struct, IComparable, IFormattable;
/// <summary> /// <summary>
/// Reads an sfixed32 field value from the stream. /// Reads an sfixed32 field value from the stream.
...@@ -214,7 +214,7 @@ namespace Google.ProtocolBuffers ...@@ -214,7 +214,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
[CLSCompliant(false)] [CLSCompliant(false)]
void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list, out ICollection<object> unknown) void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list, out ICollection<object> unknown)
where T : struct, IComparable, IFormattable, IConvertible; where T : struct, IComparable, IFormattable;
/// <summary> /// <summary>
/// Reads a set of messages using the <paramref name="messageType"/> as a template. T is not guaranteed to be /// Reads a set of messages using the <paramref name="messageType"/> as a template. T is not guaranteed to be
......
...@@ -292,7 +292,7 @@ namespace Google.ProtocolBuffers ...@@ -292,7 +292,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
[CLSCompliant(false)] [CLSCompliant(false)]
void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list) void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
where T : struct, IComparable, IFormattable, IConvertible; where T : struct, IComparable, IFormattable;
/// <summary> /// <summary>
/// Writes a packed repeated primitive, including tag and length, to the stream. /// Writes a packed repeated primitive, including tag and length, to the stream.
...@@ -369,6 +369,6 @@ namespace Google.ProtocolBuffers ...@@ -369,6 +369,6 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
[CLSCompliant(false)] [CLSCompliant(false)]
void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list) void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
where T : struct, IComparable, IFormattable, IConvertible; where T : struct, IComparable, IFormattable;
} }
} }
\ No newline at end of file
...@@ -124,10 +124,12 @@ namespace Google.ProtocolBuffers ...@@ -124,10 +124,12 @@ namespace Google.ProtocolBuffers
return new MessageStreamIterator<TMessage>(streamProvider, extensionRegistry, newSizeLimit); return new MessageStreamIterator<TMessage>(streamProvider, extensionRegistry, newSizeLimit);
} }
#if CLIENTPROFILE
public static MessageStreamIterator<TMessage> FromFile(string file) public static MessageStreamIterator<TMessage> FromFile(string file)
{ {
return new MessageStreamIterator<TMessage>(() => File.OpenRead(file), ExtensionRegistry.Empty); return new MessageStreamIterator<TMessage>(() => File.OpenRead(file), ExtensionRegistry.Empty);
} }
#endif
public static MessageStreamIterator<TMessage> FromStreamProvider(StreamProvider streamProvider) public static MessageStreamIterator<TMessage> FromStreamProvider(StreamProvider streamProvider)
{ {
......
...@@ -708,7 +708,7 @@ namespace Google.ProtocolBuffers ...@@ -708,7 +708,7 @@ namespace Google.ProtocolBuffers
{ {
// Explicitly specify the invariant culture so that this code does not break when // Explicitly specify the invariant culture so that this code does not break when
// executing in Turkey. // executing in Turkey.
String lowerName = name.ToLower(FrameworkPortability.InvariantCulture); String lowerName = name.ToLowerInvariant();
field = type.FindDescriptor<FieldDescriptor>(lowerName); field = type.FindDescriptor<FieldDescriptor>(lowerName);
// If the case-insensitive match worked but the field is NOT a group, // If the case-insensitive match worked but the field is NOT a group,
// TODO(jonskeet): What? Java comment ends here! // TODO(jonskeet): What? Java comment ends here!
......
...@@ -338,7 +338,7 @@ namespace Google.ProtocolBuffers ...@@ -338,7 +338,7 @@ namespace Google.ProtocolBuffers
NextToken(); NextToken();
return negative ? double.NegativeInfinity : double.PositiveInfinity; return negative ? double.NegativeInfinity : double.PositiveInfinity;
} }
if (currentToken.Equals("nan", StringComparison.InvariantCultureIgnoreCase)) if (currentToken.Equals("nan", StringComparison.OrdinalIgnoreCase))
{ {
NextToken(); NextToken();
return Double.NaN; return Double.NaN;
......
...@@ -1280,9 +1280,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1280,9 +1280,7 @@ namespace Google.ProtocolBuffers.TestProtos {
#endregion #endregion
#region Services #region Services
[global::System.Runtime.InteropServices.GuidAttribute("a65f0925-fd11-4f94-b166-89ac4f027205")]
public partial interface ISearchService { public partial interface ISearchService {
[global::System.Runtime.InteropServices.DispId(5)]
global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest); global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest);
global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest); global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest);
} }
......
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