2008-05-15 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Thu, 15 May 2008 01:32:36 +0000 (01:32 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Thu, 15 May 2008 01:32:36 +0000 (01:32 -0000)
* AspComponentFoundry.cs: treat AssemblyFoundry in a special way
when adding a foundry to the array list. AssemblyFoundry instances
are stacked at the end of the array list in a LIFO manner. That
way TagNameFoundry takes precedence over AssemblyFoundry should
the two contain the same type.

2008-05-14  Marek Habersack  <mhabersack@novell.com>

* AssemblyResourceLoader.cs: do not add the same entry to a
hashtable twice

svn path=/trunk/mcs/; revision=103243

mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/System.Web.Compilation/ParseException.cs
mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
mcs/class/System.Web/System.Web.Handlers/ChangeLog

index cd38351b89ccce2881d08c1ce6a91836c674883a..9aab377ad7cf7e8eb384b7a3d0af7280aee3d006 100644 (file)
@@ -76,6 +76,7 @@ namespace System.Web.Compilation
                        source = null;
                        fromConfig = false;
                        object o = foundries [foundryName];
+                       
                        if (o == null)
                                return null;
 
@@ -89,7 +90,7 @@ namespace System.Web.Compilation
                        if (af == null)
                                return null;
 
-                       Type t;
+                       Type t = null;
                        Exception e = null;
                        foreach (Foundry f in af) {
                                try {
@@ -231,8 +232,19 @@ namespace System.Web.Compilation
                                af.Add (f);
                                foundries [foundryName] = af;
                        }
-                       
-                       af.Insert (0, newFoundry);
+
+                       if (newFoundry is AssemblyFoundry) {
+                               object o;
+                               for (int i = 0; i < af.Count; i++) {
+                                       o = af [i];
+                                       if (o is AssemblyFoundry) {
+                                               af.Insert (i, newFoundry);
+                                               return;
+                                       }
+                               }
+                               af.Add (newFoundry);
+                       } else
+                               af.Insert (0, newFoundry);
                }
 
                public bool LookupFoundry (string foundryName)
index 57a60ee01044555ef3a062a6ce7f313f3df3419f..e5ea2fe22a3a3b737e1df6ad49d923ab06e715ac 100644 (file)
@@ -1,3 +1,16 @@
+2008-05-15  Marek Habersack  <mhabersack@novell.com>
+
+       * AspComponentFoundry.cs: treat AssemblyFoundry in a special way
+       when adding a foundry to the array list. AssemblyFoundry instances
+       are stacked at the end of the array list in a LIFO manner. That
+       way TagNameFoundry takes precedence over AssemblyFoundry should
+       the two contain the same type.
+
+2008-05-14  Marek Habersack  <mhabersack@novell.com>
+
+       * ParseException.cs: location can be null in the FileText property
+       getter.
+
 2008-05-07  Marek Habersack  <mhabersack@novell.com>
 
        * AspGenerator.cs: push the include file directory to the parser
index 7d89693e259eb16963d9b5bb74dd3456d9e3e49f..bcdcf82a6085d3c49fe89b7a008ab8a86c19668b 100644 (file)
@@ -84,7 +84,7 @@ namespace System.Web.Compilation
                                if (fileText != null)
                                        return fileText;
 
-                               string text = location.FileText;
+                               string text = location != null ? location.FileText : null;
                                if (text != null && text.Length > 0)
                                        return text;
                                
index 94caf82c3e35fd162f5c4b28a93e36b0aa7ba7db..9b399021161be575f19f8ac76c5c4c2b200b9529 100644 (file)
@@ -71,10 +71,16 @@ namespace System.Web.Handlers {
                                string resourceName = attrs [i].WebResource;
                                if (resourceName != null && resourceName.Length > 0) {
 #if SYSTEM_WEB_EXTENSIONS
-                                       hashtable.Add (new ResourceKey (resourceName, false), CreateResourceUrl (assembly, resourceName, false));
-                                       hashtable.Add (new ResourceKey (resourceName, true), CreateResourceUrl (assembly, resourceName, true));
+                                       ResourceKey rkNoNotify = new ResourceKey (resourceName, false);
+                                       ResourceKey rkNotify = new ResourceKey (resourceName, true);
+
+                                       if (!hashtable.Contains (rkNoNotify))
+                                               hashtable.Add (rkNoNotify, CreateResourceUrl (assembly, resourceName, false));
+                                       if (!hashtable.Contains (rkNotify))
+                                               hashtable.Add (rkNotify, CreateResourceUrl (assembly, resourceName, true));
 #else
-                                       hashtable.Add (resourceName, CreateResourceUrl (assembly, resourceName, false));
+                                       if (!hashtable.Contains (resourceName))
+                                               hashtable.Add (resourceName, CreateResourceUrl (assembly, resourceName, false));
 #endif
                                }
                        }
index 71173500d5739bdc69e9ae2ea5e694c7a8809275..a27895e7caf676e33d6ccd02f73a2d587f20c104 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-14  Marek Habersack  <mhabersack@novell.com>
+
+       * AssemblyResourceLoader.cs: do not add the same entry to a
+       hashtable twice
+
 2008-04-15  Marek Habersack  <mhabersack@novell.com>
 
        * AssemblyResourceLoader.cs: dispose of streams the way it should