2010-01-27 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 27 Jan 2010 05:42:33 +0000 (05:42 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 27 Jan 2010 05:42:33 +0000 (05:42 -0000)
* JsonSerializationReader.cs : oops, wrong fix, should consume the
  reader.

svn path=/trunk/mcs/; revision=150277

mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/ChangeLog
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs

index dcc5da77723c9c216d255732bd168c553915e56a..b8b99546c292836a5821deefc36dfaefbacf4906 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonSerializationReader.cs : oops, wrong fix, should consume the
+         reader.
+
 2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
 
        * JsonSerializationReader.cs : "null" for string should be read as
index c7cdde198b0d31ebb9222f4282b282b098eb0b2e..076ce33e5f07563f9966632a54705a56673c3b58 100644 (file)
@@ -80,7 +80,12 @@ namespace System.Runtime.Serialization.Json
                                        throw new SerializationException (String.Format ("The only expected DBNull value string is '{{}}'. Tha actual input was '{0}'.", dbn));
                                return DBNull.Value;
                        case TypeCode.String:
-                               return isNull ? null : reader.ReadElementContentAsString ();
+                               if (isNull) {
+                                       reader.ReadElementContentAsString ();
+                                       return null;
+                               }
+                               else
+                                       return reader.ReadElementContentAsString ();
                        case TypeCode.Single:
                                return reader.ReadElementContentAsFloat ();
                        case TypeCode.Double:
@@ -111,7 +116,12 @@ namespace System.Runtime.Serialization.Json
                                if (type == typeof (Guid)) {
                                        return new Guid (reader.ReadElementContentAsString ());
                                } else if (type == typeof (Uri)) {
-                                       return isNull ? null : new Uri (reader.ReadElementContentAsString ());
+                                       if (isNull) {
+                                               reader.ReadElementContentAsString ();
+                                               return null;
+                                       }
+                                       else
+                                               return new Uri (reader.ReadElementContentAsString ());
                                } else if (type == typeof (XmlQualifiedName)) {
                                        string s = reader.ReadElementContentAsString ();
                                        int idx = s.IndexOf (':');