[Mono-dev] Replicating System.Web.Script.Serialization bugs

Adar Wesley adar.wesley at gmail.com
Mon Oct 1 13:17:43 EDT 2007


Hi Kosta and Tyler,

Having worked on this code with Kosta and following this thread a couple of
questions come to my mind.

1. Are there any other types that need special care, besides Nullable?  How
about generic types?
    As far as I remember, we don't have any tests with generics.  Are we
missing anything else?

2. I was trying to think of a good strategy for implementing this, and
havn't made up my mind yet.
    I agree with Kosta that the try, catch approach is not the best way.  I
think something a bit more fine grained
    should be used.  What would happen if the value is "xxx" and the type is
"int?"?  This should probably
    throw the error and not silently assign the null value.  (Requires a
test with MS code...)

Just my two cents.

---
Adar Wesley


On 10/1/07, Konstantin Triger <kostat at mainsoft.com> wrote:
>
> Try/catch does not seem the best way to do it, and unfortunately I don't
> have time now to look into the code.
>
> Temporary you may yet do this workaround and compile your own version, so
> unblock yourself until the fix is available.
>
> Regards,
> Konstantin Triger
>
> > -----Original Message-----
> > From: R. Tyler Ballance [mailto:tyler at monkeypox.org]
> > Sent: Monday, October 01, 2007 12:06 PM
> > To: Konstantin Triger
> > Cc: mono-devel-list at lists.ximian.com
> > Subject: Re: [Mono-dev] Replicating System.Web.Script.Serialization bugs
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> >
> > On Oct 1, 2007, at 1:42 AM, Konstantin Triger wrote:
> >
> > > Hey Tyler,
> > >
> > > If you need this urgently, please provide a fix.
> > > If not - it will be somewhere in my todo list and will be fixed in
> > > a couple of weeks.
> >
> >
> > Would you recommend just adding another if statement in:
> > > internal object ConvertToType (Type type, object obj)
> >
> > Or is the bug elsewhere? The best I could tell as far as a fix would
> > be would be to check if it's a Nullable type, and then try/catch a
> > convert recursing into ConvertToType and in the catch setting
> > hasValue = false, etc.
> >
> > If you can take the time to suggest a plan of action, I'd be more
> > than happy to fix, test and commit a patch for this, since it's
> > somewhat blocking me right now :)
> >
> >
> > Cheers
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.7 (Darwin)
> >
> > iD8DBQFHAMahA2GmJ0VpG78RAj6DAJwNBqkPL85OBjufkZafa4v6/lW60wCgoiJT
> > DUyhiLCjc+xXrwQ6i8ouMcY=
> > =rs5n
> > -----END PGP SIGNATURE-----
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
---
Adar Wesley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071001/ad739ca1/attachment.html 


More information about the Mono-devel-list mailing list