aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-09-09 22:16:08 -0500
committerrogerk <devnull@localhost>2011-09-09 22:16:08 -0500
commitc86b504409f0b1b57764fd42376de28b13968a8f (patch)
tree1d32b2165e6c4665390d2ec5bbe972ba25e7cd02
parentf52ec95ad50b352ed82449f9cbef48f6edd50149 (diff)
downloadprotobuf-c86b504409f0b1b57764fd42376de28b13968a8f.tar.gz
protobuf-c86b504409f0b1b57764fd42376de28b13968a8f.tar.bz2
protobuf-c86b504409f0b1b57764fd42376de28b13968a8f.zip
Missing braces :)
-rw-r--r--src/ProtocolBuffers.Serialization/JsonFormatWriter.cs4
-rw-r--r--src/ProtocolBuffers.Serialization/XmlFormatWriter.cs6
-rw-r--r--src/ProtocolBuffers/CodedOutputStream.cs2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs b/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
index f387f39d..15e08e05 100644
--- a/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
+++ b/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
@@ -246,8 +246,10 @@ namespace Google.ProtocolBuffers.Serialization
{
if (disposing)
{
- while(_counter.Count > 1)
+ while (_counter.Count > 1)
+ {
WriteMessageEnd();
+ }
}
base.Dispose(disposing);
diff --git a/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs b/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs
index 79f403df..3c5cb3ab 100644
--- a/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs
+++ b/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs
@@ -78,8 +78,10 @@ namespace Google.ProtocolBuffers.Serialization
{
if (disposing)
{
- while(_messageOpenCount > 0)
+ while (_messageOpenCount > 0)
+ {
WriteMessageEnd();
+ }
_output.Close();
}
@@ -163,7 +165,9 @@ namespace Google.ProtocolBuffers.Serialization
public override void WriteMessageEnd()
{
if (_messageOpenCount <= 0)
+ {
throw new InvalidOperationException();
+ }
_output.WriteEndElement();
_output.Flush();
diff --git a/src/ProtocolBuffers/CodedOutputStream.cs b/src/ProtocolBuffers/CodedOutputStream.cs
index 560719af..37c60387 100644
--- a/src/ProtocolBuffers/CodedOutputStream.cs
+++ b/src/ProtocolBuffers/CodedOutputStream.cs
@@ -131,7 +131,9 @@ namespace Google.ProtocolBuffers
if (output != null)
{
if (position > 0)
+ {
Flush();
+ }
output.Dispose();
}
}