aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/GeneratedBuilder.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-09-28 11:31:27 -0500
committerrogerk <devnull@localhost>2011-09-28 11:31:27 -0500
commit8c2b8d11de91ae7869d19a94e48e993e97455470 (patch)
treec6056349009e6b0f0c523835ada884522cb67ed8 /src/ProtocolBuffers/GeneratedBuilder.cs
parent7f20cc9084d929d2506ed9f2dccff09c51165d1f (diff)
parent3b625064e8e40f37ec510cc4f25035a9c1554c73 (diff)
downloadprotobuf-8c2b8d11de91ae7869d19a94e48e993e97455470.tar.gz
protobuf-8c2b8d11de91ae7869d19a94e48e993e97455470.tar.bz2
protobuf-8c2b8d11de91ae7869d19a94e48e993e97455470.zip
merged issue-22
Diffstat (limited to 'src/ProtocolBuffers/GeneratedBuilder.cs')
-rw-r--r--src/ProtocolBuffers/GeneratedBuilder.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ProtocolBuffers/GeneratedBuilder.cs b/src/ProtocolBuffers/GeneratedBuilder.cs
index a56be42e..fd6fe4d7 100644
--- a/src/ProtocolBuffers/GeneratedBuilder.cs
+++ b/src/ProtocolBuffers/GeneratedBuilder.cs
@@ -58,12 +58,7 @@ namespace Google.ProtocolBuffers
protected internal FieldAccessorTable<TMessage, TBuilder> InternalFieldAccessors
{
- get { return MessageBeingBuilt.FieldAccessorsFromBuilder; }
- }
-
- public override bool IsInitialized
- {
- get { return MessageBeingBuilt.IsInitialized; }
+ get { return DefaultInstanceForType.FieldAccessorsFromBuilder; }
}
public override IDictionary<FieldDescriptor, object> AllFields
@@ -97,7 +92,7 @@ namespace Google.ProtocolBuffers
public override MessageDescriptor DescriptorForType
{
- get { return MessageBeingBuilt.DescriptorForType; }
+ get { return DefaultInstanceForType.DescriptorForType; }
}
public override int GetRepeatedFieldCount(FieldDescriptor field)
@@ -204,7 +199,7 @@ namespace Google.ProtocolBuffers
public override TMessage Build()
{
// If the message is null, we'll throw a more appropriate exception in BuildPartial.
- if (MessageBeingBuilt != null && !IsInitialized)
+ if (!IsInitialized)
{
throw new UninitializedMessageException(MessageBeingBuilt);
}