Anyway, here's the patch. Can someone please review it and commit?
This patch fixed all my solution compilation problems and believe me, I had
plenty of them.

Basically I replaced all "new Hashtable()" with CollectionUtil.Create...
and killed all "ToLower()'s" where it made sense.

This patch was made against a fresh anonymous CVS checkout, but AFAIK
sourceforge.net introduces some serious lag for anoncvs. I couldn't checkout
the sources using my sf.net account "jkowalski" because of permission
problems.

Jarek

----- Original Message ----- 
From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
To: "NAnt Developers" <[EMAIL PROTECTED]>
Sent: Tuesday, August 12, 2003 8:16 AM
Subject: [nant-dev] <solution> and case sensitivity


> 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
>

Attachment: ci_hashtable.patch
Description: Binary data

Reply via email to