Author: mhabersack
Date: 2007-06-20 13:25:25 -0400 (Wed, 20 Jun 2007)
New Revision: 80340
Modified:
trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs
trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog
Log:
2007-06-20 Marek Habersack <[EMAIL PROTECTED]>
* Cache.cs: Iterate over the entries when filling the ArrayList in the
2.0
profile to avoid type cast exceptions.
Modified: trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs 2007-06-20
17:21:03 UTC (rev 80339)
+++ trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs 2007-06-20
17:25:25 UTC (rev 80340)
@@ -214,8 +214,12 @@
{
ArrayList list = new ArrayList ();
lock (cache) {
+#if NET_2_0
foreach (CacheItem it in cache.Values)
list.Add (it);
+#else
+ list.AddRange (cache.Values);
+#endif
}
return new CacheItemEnumerator (list);
}
@@ -240,7 +244,12 @@
ArrayList list;
lock (cache) {
list = new ArrayList ();
+#if NET_2_0
+ foreach (CacheItem it in cache.Values)
+ list.Add (it);
+#else
list.AddRange (cache.Values);
+#endif
needsTimer = false;
}
Modified: trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog 2007-06-20
17:21:03 UTC (rev 80339)
+++ trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog 2007-06-20
17:25:25 UTC (rev 80340)
@@ -8,6 +8,8 @@
latter was moved to one of the Insert overloads.
Private entries are no longer handled specifically, because the
internal cache is now kept in a separate object.
+ Iterate over the entries when filling the ArrayList in the 2.0
+ profile to avoid type cast exceptions.
2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches