[Mono-dev] SoapFormatter patch

Joel Reed joelwreed at gmail.com
Wed Oct 10 10:19:18 EDT 2007


On Sun, Oct 07, 2007 at 09:15:20AM -0700, Roei Erez wrote:
> Hi all,
> 
> Attached is a patch for SoapTypeMapper.cs.
> 
> This patch saves a redundant call to Type.GetType(xmlName) that fails most of
> the time.
> 
> Please review.

1) please include small patches for review inline. it makes it
easier to provide feedback.

2) please run the test suite and confirm your changes don't break
anything when posting a patch for review.

>
> Index: SoapTypeMapper.cs
> ===================================================================
> --- SoapTypeMapper.cs (revision 87053)
> +++ SoapTypeMapper.cs (working copy)
> @@ -194,8 +194,9 @@
>         out typeNamespace, 
>         out assemblyName);
>  
> -     string typeName = typeNamespace + Type.Delimiter +
>       localName;
> -
> +     string typeName = (typeNamespace == null || typeNamespace
>       == String.Empty) ?

String.IsNullOrEmpty(typeNamespace) would be better.

> +               localName : typeNamespace + Type.Delimiter +
>       localName;
> +     
>       if(assemblyName != null && assemblyName != string.Empty &&
>       _binder != null) 
>       {
>         type = _binder.BindToType(assemblyName, typeName);
> @@ -206,25 +207,20 @@
>         if(assemblyQualifiedName != null)
>           type = Type.GetType(assemblyQualifiedName);
>         else
> -       {
> -         type = Type.GetType(xmlName);
> +       {         
> +         type = Type.GetType(typeName);
>           if(type == null) 
> -         { 
> +         {

that last hunk looks like a needless whitespace change. please
fix.

thanks.

jr



More information about the Mono-devel-list mailing list