[Mono-dev] Patch to add missing v2 System.Exception constructors, and HResult consistency
Andy Hume
andyhume32 at yahoo.co.uk
Wed Jan 10 17:07:30 EST 2007
Woops, if the patch is possibly useable I should attach it! This time.
> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf
> Of Andy Hume
> Sent: 10 January 2007 20:00
> To: mono-devel-list at lists.ximian.com
> Subject: [Mono-dev] Patch to add missing v2 System.Exception
> constructors,and HResult consistency
>
> A project of mine uses #ctor(String,Exception) on
> ObjectDisposedException, so I looked at adding that, and any
> other similar constructors missing as per the class status report.
>
> I also spotted inconsistent setting of HResult, and fixed
> those too. For instance, ArgumentNullException sets HResult
> only in three out of the four constuctors; not setting it in
> the v2 (String,Exception) one -- and correctly not in the
> Serialization constructor.
>
>
> So, I fixed the remaining missing (String,Exception)
> constructors in corlib (2 of), and fixed the Hresult setting
> in all exceptions there (4 of).
>
> The remaining Exception constructor omission listed was
> InvalidCastException.ctor(System.String, System.Int32). MSDN says:
> "This constructor supplies an HRESULT value that is
> accessible to inheritors of the InvalidCastException class,
> via the protected HResult property of the Exception class."
> I added that method too, setting the HResult property from
> the Int32 argument.
>
>
> I attach a patch for all that. A caveat though, as I expect
> setting up the build environment may take me some time on my
> Windows box, I added all the corlib files into a Visual
> Studio project and compiled it there... So no further
> testing could be done... Don't know whether that's of any
> use, or just trouble. :-,(
>
> Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: System.diff
Type: application/octet-stream
Size: 3877 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070110/f0361685/attachment.obj
More information about the Mono-devel-list
mailing list