aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r--csharp/src/Google.Protobuf/Collections/MapField.cs7
-rw-r--r--csharp/src/Google.Protobuf/Collections/RepeatedField.cs4
-rw-r--r--csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs66
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Any.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Api.cs6
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs9
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs3
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Type.cs15
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs27
13 files changed, 2 insertions, 150 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs
index 0f7227c2..9f460e1e 100644
--- a/csharp/src/Google.Protobuf/Collections/MapField.cs
+++ b/csharp/src/Google.Protobuf/Collections/MapField.cs
@@ -54,7 +54,6 @@ namespace Google.Protobuf.Collections
{
// TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.)
private readonly bool allowNullValues;
- private bool frozen;
private readonly Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>> map =
new Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>>();
private readonly LinkedList<KeyValuePair<TKey, TValue>> list = new LinkedList<KeyValuePair<TKey, TValue>>();
@@ -254,7 +253,7 @@ namespace Google.Protobuf.Collections
public bool AllowsNullValues { get { return allowNullValues; } }
public int Count { get { return list.Count; } }
- public bool IsReadOnly { get { return frozen; } }
+ public bool IsReadOnly { get { return false; } }
public override bool Equals(object other)
{
@@ -416,10 +415,6 @@ namespace Google.Protobuf.Collections
set
{
- if (frozen)
- {
- throw new NotSupportedException("Dictionary is frozen");
- }
this[(TKey)key] = (TValue)value;
}
}
diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
index e7fc0a3f..3ce19c81 100644
--- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
+++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
@@ -40,7 +40,7 @@ namespace Google.Protobuf.Collections
{
/// <summary>
/// The contents of a repeated field: essentially, a collection with some extra
- /// restrictions (no null values) and capabilities (deep cloning and freezing).
+ /// restrictions (no null values) and capabilities (deep cloning).
/// </summary>
/// <typeparam name="T">The element type of the repeated field.</typeparam>
public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>>
@@ -48,7 +48,6 @@ namespace Google.Protobuf.Collections
private static readonly T[] EmptyArray = new T[0];
private const int MinArraySize = 8;
- private bool frozen;
private T[] array = EmptyArray;
private int count = 0;
@@ -66,7 +65,6 @@ namespace Google.Protobuf.Collections
public RepeatedField<T> Clone()
{
RepeatedField<T> clone = new RepeatedField<T>();
- // Clone is implicitly *not* frozen, even if this object is.
if (array != EmptyArray)
{
clone.array = (T[])array.Clone();
diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs
index 6f55f5ab..213863e2 100644
--- a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs
+++ b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs
@@ -173,9 +173,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FileDescriptorSet() {
OnConstruction();
}
@@ -274,9 +271,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FileDescriptorProto() {
OnConstruction();
}
@@ -627,9 +621,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public DescriptorProto() {
OnConstruction();
}
@@ -913,9 +904,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public ExtensionRange() {
OnConstruction();
}
@@ -1048,9 +1036,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public ReservedRange() {
OnConstruction();
}
@@ -1188,9 +1173,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FieldDescriptorProto() {
OnConstruction();
}
@@ -1544,9 +1526,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public OneofDescriptorProto() {
OnConstruction();
}
@@ -1653,9 +1632,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public EnumDescriptorProto() {
OnConstruction();
}
@@ -1812,9 +1788,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public EnumValueDescriptorProto() {
OnConstruction();
}
@@ -1979,9 +1952,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public ServiceDescriptorProto() {
OnConstruction();
}
@@ -2138,9 +2108,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public MethodDescriptorProto() {
OnConstruction();
}
@@ -2383,9 +2350,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FileOptions() {
OnConstruction();
}
@@ -2860,9 +2824,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public MessageOptions() {
OnConstruction();
}
@@ -3065,9 +3026,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FieldOptions() {
OnConstruction();
}
@@ -3340,9 +3298,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public EnumOptions() {
OnConstruction();
}
@@ -3493,9 +3448,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public EnumValueOptions() {
OnConstruction();
}
@@ -3620,9 +3572,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public ServiceOptions() {
OnConstruction();
}
@@ -3747,9 +3696,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public MethodOptions() {
OnConstruction();
}
@@ -3874,9 +3820,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public UninterpretedOption() {
OnConstruction();
}
@@ -4132,9 +4075,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public NamePart() {
OnConstruction();
}
@@ -4272,9 +4212,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public SourceCodeInfo() {
OnConstruction();
}
@@ -4374,9 +4311,6 @@ namespace Google.Protobuf.Reflection {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Location() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
index 7882b991..86c8552f 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
@@ -51,9 +51,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Any() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
index a066fd51..a8d4942a 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
@@ -61,9 +61,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Api() {
OnConstruction();
}
@@ -264,9 +261,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Method() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
index 3c43d634..26c8d2b6 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
@@ -52,9 +52,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Duration() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
index f3104409..e14992f4 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
@@ -51,9 +51,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Empty() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
index c090aae8..45ef9859 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
@@ -51,9 +51,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FieldMask() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
index 73874cf1..c86dbada 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
@@ -52,9 +52,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public SourceContext() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
index bb2e5c1b..a4411dd0 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
@@ -70,9 +70,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Struct() {
OnConstruction();
}
@@ -171,9 +168,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Value() {
OnConstruction();
}
@@ -459,9 +453,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public ListValue() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
index f66b1f43..3c42068a 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
@@ -52,9 +52,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Timestamp() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
index 719131a4..91ac0f6b 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
@@ -82,9 +82,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Type() {
OnConstruction();
}
@@ -277,9 +274,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Field() {
OnConstruction();
}
@@ -594,9 +588,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Enum() {
OnConstruction();
}
@@ -771,9 +762,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public EnumValue() {
OnConstruction();
}
@@ -924,9 +912,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Option() {
OnConstruction();
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
index 73577366..a5f6b7e8 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
@@ -61,9 +61,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public DoubleValue() {
OnConstruction();
}
@@ -170,9 +167,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public FloatValue() {
OnConstruction();
}
@@ -279,9 +273,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Int64Value() {
OnConstruction();
}
@@ -388,9 +379,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public UInt64Value() {
OnConstruction();
}
@@ -497,9 +485,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public Int32Value() {
OnConstruction();
}
@@ -606,9 +591,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public UInt32Value() {
OnConstruction();
}
@@ -715,9 +697,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public BoolValue() {
OnConstruction();
}
@@ -824,9 +803,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public StringValue() {
OnConstruction();
}
@@ -933,9 +909,6 @@ namespace Google.Protobuf.WellKnownTypes {
get { return Descriptor; }
}
- private bool _frozen = false;
- public bool IsFrozen { get { return _frozen; } }
-
public BytesValue() {
OnConstruction();
}