diff options
author | csharptest <roger@csharptest.net> | 2010-11-04 19:57:23 -0500 |
---|---|---|
committer | unknown <rknapp@.svault.int> | 2010-11-04 19:57:23 -0500 |
commit | dce2b9d10e3002f7d3e6687ae5dd72c24175bbeb (patch) | |
tree | 5a977c6538b4c9167432fae807a007f5f5dc82b5 /src/ProtocolBuffers | |
parent | d9c59e66131b34833f04c591fa8fe8719afa0b47 (diff) | |
download | protobuf-dce2b9d10e3002f7d3e6687ae5dd72c24175bbeb.tar.gz protobuf-dce2b9d10e3002f7d3e6687ae5dd72c24175bbeb.tar.bz2 protobuf-dce2b9d10e3002f7d3e6687ae5dd72c24175bbeb.zip |
Fixed issue in AsReadOnly()
Diffstat (limited to 'src/ProtocolBuffers')
-rw-r--r-- | src/ProtocolBuffers/ExtensionRegistry.cs | 5 | ||||
-rw-r--r-- | src/ProtocolBuffers/ExtensionRegistryLite.cs | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ProtocolBuffers/ExtensionRegistry.cs b/src/ProtocolBuffers/ExtensionRegistry.cs index 02cd4631..32408b09 100644 --- a/src/ProtocolBuffers/ExtensionRegistry.cs +++ b/src/ProtocolBuffers/ExtensionRegistry.cs @@ -119,9 +119,12 @@ namespace Google.ProtocolBuffers { get { return empty; } } - public override ExtensionRegistryLite AsReadOnly() { + public new ExtensionRegistry AsReadOnly() { return new ExtensionRegistry(extensionsByName, extensionsByNumber, true); } + protected override ExtensionRegistryLite MakeReadOnly() { + return AsReadOnly(); + } /// <summary> /// Finds an extension by fully-qualified field name, in the diff --git a/src/ProtocolBuffers/ExtensionRegistryLite.cs b/src/ProtocolBuffers/ExtensionRegistryLite.cs index 693aeb2c..b0548235 100644 --- a/src/ProtocolBuffers/ExtensionRegistryLite.cs +++ b/src/ProtocolBuffers/ExtensionRegistryLite.cs @@ -119,7 +119,11 @@ namespace Google.ProtocolBuffers { get { return empty; } } - public virtual ExtensionRegistryLite AsReadOnly() { + public ExtensionRegistryLite AsReadOnly() { + return MakeReadOnly(); + } + + protected virtual ExtensionRegistryLite MakeReadOnly() { return new ExtensionRegistryLite(extensionsByNumber, true); } |