[Mono-dev] [PATCH] Default value fixes for WebControl, + UnitConverter infinite loop fix

Gonzalo Paniagua Javier gonzalo at ximian.com
Mon Aug 22 11:47:50 EDT 2005


On Fri, 2005-08-19 at 15:08 +0100, Michael Hutchinson wrote:
> Some corrected default values for the properties of
> System.Web.UI.WebControls.WebControl.
> There's also a fix for a potential infinite loop in UnitConverter that
> occurs when converting to/from non-string types.
> 
> Could someone review this, and if ther are no objections I'll commit it.

Please, do.

> 
> On a related note, I am uncomfortable with the constructor for
> System.ComponentModel.DefaultValueAttribute.cs
> 
> public DefaultValueAttribute (Type type, string value)
> {
> 	try {
> 		TypeConverter converter = TypeDescriptor.GetConverter (type);
> 		DefaultValue = converter.ConvertFromString (null,
> CultureInfo.InvariantCulture, value);
> 	} catch { }
> }
> It should not be swallowing exceptions; if there are any, then the
> dveloper has given the DefaultValueAttribute a bad value. However, I'm
> reluctant to suggest changing this right now in case it breaks
> anything.

That code fixed a bug report. I don't remember if we added a test case
for it or not...

-Gonzalo





More information about the Mono-devel-list mailing list