diff options
author | Jon Skeet <skeet@pobox.com> | 2009-06-17 16:09:22 +0100 |
---|---|---|
committer | unknown <Jon Skeet@.(none)> | 2009-06-17 16:09:22 +0100 |
commit | cb8644df88191034f9ba47a1f4e60f5aa924a338 (patch) | |
tree | 5afc864b029c14bdde75ba5b35c512500a2bfcbd | |
parent | c784be314952bef6d6335d6156679771a47c035a (diff) | |
download | protobuf-cb8644df88191034f9ba47a1f4e60f5aa924a338.tar.gz protobuf-cb8644df88191034f9ba47a1f4e60f5aa924a338.tar.bz2 protobuf-cb8644df88191034f9ba47a1f4e60f5aa924a338.zip |
Fixed a couple of warnings
-rw-r--r-- | src/ProtocolBuffers/MessageStreamIterator.cs | 9 | ||||
-rw-r--r-- | src/ProtocolBuffers/UninitializedMessageException.cs | 12 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/ProtocolBuffers/MessageStreamIterator.cs b/src/ProtocolBuffers/MessageStreamIterator.cs index cb1ead1a..e27447f3 100644 --- a/src/ProtocolBuffers/MessageStreamIterator.cs +++ b/src/ProtocolBuffers/MessageStreamIterator.cs @@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers { /// <summary> /// Works out the builder type for TMessage, or throws an ArgumentException to explain why it can't. - /// This will check /// </summary> private static Type FindBuilderType() { MethodInfo createBuilderMethod = typeof(TMessage).GetMethod("CreateBuilder", Type.EmptyTypes); @@ -87,6 +86,9 @@ namespace Google.ProtocolBuffers { return builderType; } +// This is only ever fetched by reflection, so the compiler may +// complain that it's unused +#pragma warning disable 0414 /// <summary> /// Method we'll use to build messageReader, with the first parameter fixed to TMessage.CreateBuilder. Note that we /// have to introduce another type parameter (TMessage2) as we can't constrain TMessage for just a single method @@ -101,8 +103,9 @@ namespace Google.ProtocolBuffers { TBuilder builder = builderBuilder(); input.ReadMessage(builder, registry); return builder.Build(); - } - + } +#pragma warning restore 0414 + private static readonly uint ExpectedTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); private MessageStreamIterator(StreamProvider streamProvider, ExtensionRegistry extensionRegistry) { diff --git a/src/ProtocolBuffers/UninitializedMessageException.cs b/src/ProtocolBuffers/UninitializedMessageException.cs index d0a57906..e35c945b 100644 --- a/src/ProtocolBuffers/UninitializedMessageException.cs +++ b/src/ProtocolBuffers/UninitializedMessageException.cs @@ -53,6 +53,15 @@ namespace Google.ProtocolBuffers { this.missingFields = Lists.AsReadOnly(missingFields); } + + /// <summary> + /// Returns a read-only list of human-readable names of + /// required fields missing from this message. Each name + /// is a full path to a field, e.g. "foo.bar[5].baz" + /// </summary> + public IList<string> MissingFields { + get { return missingFields; } + } /// <summary> /// Converts this exception into an InvalidProtocolBufferException. @@ -138,6 +147,3 @@ namespace Google.ProtocolBuffers { } } } - - - |