Commit 6c69373f authored by csharptest's avatar csharptest Committed by rogerk

bla, changed name to Depth for CLSComplaint :)

parent 3b70dd78
...@@ -13,7 +13,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -13,7 +13,7 @@ namespace Google.ProtocolBuffers.Serialization
public abstract class AbstractReader : ICodedInputStream public abstract class AbstractReader : ICodedInputStream
{ {
const int MaxDepth = CodedInputStream.DefaultRecursionLimit; const int MaxDepth = CodedInputStream.DefaultRecursionLimit;
protected int _depth; protected int Depth;
/// <summary> /// <summary>
/// Merges the contents of stream into the provided message builder /// Merges the contents of stream into the provided message builder
...@@ -334,10 +334,10 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -334,10 +334,10 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadGroup(int fieldNumber, IBuilderLite builder, ExtensionRegistry extensionRegistry) void ICodedInputStream.ReadGroup(int fieldNumber, IBuilderLite builder, ExtensionRegistry extensionRegistry)
{ {
if (_depth++ > MaxDepth) if (Depth++ > MaxDepth)
throw InvalidProtocolBufferException.RecursionLimitExceeded(); throw InvalidProtocolBufferException.RecursionLimitExceeded();
ReadGroup(builder, extensionRegistry); ReadGroup(builder, extensionRegistry);
_depth--; Depth--;
} }
void ICodedInputStream.ReadUnknownGroup(int fieldNumber, IBuilderLite builder) void ICodedInputStream.ReadUnknownGroup(int fieldNumber, IBuilderLite builder)
...@@ -345,10 +345,10 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -345,10 +345,10 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry) void ICodedInputStream.ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry)
{ {
if (_depth++ > MaxDepth) if (Depth++ > MaxDepth)
throw InvalidProtocolBufferException.RecursionLimitExceeded(); throw InvalidProtocolBufferException.RecursionLimitExceeded();
ReadMessage(builder, extensionRegistry); ReadMessage(builder, extensionRegistry);
_depth--; Depth--;
} }
bool ICodedInputStream.ReadBytes(ref ByteString value) bool ICodedInputStream.ReadBytes(ref ByteString value)
...@@ -453,18 +453,18 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -453,18 +453,18 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadMessageArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, ExtensionRegistry registry) void ICodedInputStream.ReadMessageArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, ExtensionRegistry registry)
{ {
if (_depth++ > MaxDepth) if (Depth++ > MaxDepth)
throw InvalidProtocolBufferException.RecursionLimitExceeded(); throw InvalidProtocolBufferException.RecursionLimitExceeded();
ReadMessageArray(fieldName, list, messageType, registry); ReadMessageArray(fieldName, list, messageType, registry);
_depth--; Depth--;
} }
void ICodedInputStream.ReadGroupArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, ExtensionRegistry registry) void ICodedInputStream.ReadGroupArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, ExtensionRegistry registry)
{ {
if (_depth++ > MaxDepth) if (Depth++ > MaxDepth)
throw InvalidProtocolBufferException.RecursionLimitExceeded(); throw InvalidProtocolBufferException.RecursionLimitExceeded();
ReadGroupArray(fieldName, list, messageType, registry); ReadGroupArray(fieldName, list, messageType, registry);
_depth--; Depth--;
} }
bool ICodedInputStream.ReadPrimitiveField(FieldType fieldType, ref object value) bool ICodedInputStream.ReadPrimitiveField(FieldType fieldType, ref object value)
......
...@@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers.Serialization
{ {
XmlFormatReader copy = new XmlFormatReader(rdr).SetOptions(Options); XmlFormatReader copy = new XmlFormatReader(rdr).SetOptions(Options);
copy._rootElementName = _rootElementName; copy._rootElementName = _rootElementName;
copy._depth = _depth; copy.Depth = Depth;
return copy; return copy;
} }
......
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