Yesterday I've tried to compile my quite complicated project using
<solution> task and ran into some problems - mostly internal errors.

As I started debugging <solution> I found that it makes heavy use of
hashtables. Some of them are used as dictionaries indexed by strings.
Unfortunately there are many places where you insert into such a dictionary
using a lowercase string (like "aaaa") but you want to retrieve from it
using mixed-case string like "Aaaa". This mostly applies to GUIDs and
project names because some of them are .ToLower()'ed but some are not.
Because string comparisons are case-sensitive the whole thing fails.

I couldn't get the idea, why it was done that way, but I think I can provide
a patch that would make the whole <solution> task implementation more
readable and less error-prone.

The idea is to use case insensitive hashtables instead of ToLower()-ing
keys. You create hashtable like this:

---------------------
Hashtable ht = new Hashtable(
    new CaseInsensitiveHashCodeProvider(),
    new CaseInsensitiveComparer());
---------------------

or even shorter:

---------------------
Hashtable ht = CollectionsUtil.CreateCaseInsensitiveHashtable()
---------------------

and it becomes case insensitive. This way you can get rid of all
.ToLower()s.

Do you think it's a good idea? If so, I can create a patch to change it and
send it to the list.

Jarek



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to