This attribute gives us a horrible debugging experience when the
'Value' of the KeyValuePair is null. By using this attribute, the
user is told that the KeyValuePair itself is null when they inspect
something like 'new KeyValuePair<string, string> (null, null)'.
This is very confusing.
We should just let the ToString method be invoked, which returns a
nicely formatted string. This is also the behaviour observed when
debugging using Visual Studio.
* List.cs: Make sure indexers are always inlined. We use the 256 literal instead
of MethodImplOptions.AggressiveInlining since the later is only available on 4.5.
List<T>.Enumerator is a struct so current Dispose() implementation was causing mutability on it.
Depending on this behaviour may seem overkill but some codebases may implement IEnumerator<T> themselves by caching the enumerator of their initial readonly list.
Making Dispose() not do anything may seem incorrect, but it is not. For a good read about this, take a look at Stephen Cleary's first comment in:
http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/f5a59eac-4a3e-4417-99a8-83d4a6a9e41d
(Added NUnit tests that demonstrate the issue too.)
For a good example: this fix makes a simple HelloWorld System.Web.IHttpHandler work in Mono within the OpenRasta framework (at least tested with the stable branch).
The build fails because of what seems to be a bug in gmcs. The compiler reports that
the StringComparer.OrdinalIgnoreCase property doesn't exist and it does so because
gmcs loads the internal System.Collections.Generic.StringComparer from EqualitComparer.cs instead of the
System.StringComparer one.
It turns out that Strings need to explicitly use a version that does
implement EqualityComparer<string> since string is an IEquatable.
Do this, and to avoid the reflection mess, cast to object, then cast
to the real type
2010-03-19 Sebastien Pouliot <[email protected]>
* CollectionDebuggerView.cs: Change to internal so we can avoid
a duplicating the type in assemblies that have [InternalsVisibleTo]
In System.Collections.Generic:
2010-03-19 Sebastien Pouliot <[email protected]>
* CollectionDebuggerView.cs: Change to internal so we can avoid
a duplicating the type in assemblies that have [InternalsVisibleTo]
svn path=/trunk/mcs/; revision=153915
2010-01-24 Robert Jordan <[email protected]>
* Dictionary.cs: Fix deserialization compatibility with MS.NET.
Fixes bug #474009.
In Test/System.Collections.Generic:
2010-01-24 Robert Jordan <[email protected]>
* DictionaryTest.cs: Add test case for bug #474009.
svn path=/trunk/mcs/; revision=150089
* Dictionary.cs: Always create the keys, fixes compatibility
between Mono and .NET. Patch from John Lenz <[email protected]>
svn path=/trunk/mcs/; revision=149947
2009-12-06 Chris Toshok <[email protected]>
* KeyValuePair.cs: we need setters for Key and Value so they can
be set via reflection from
System.ServiceModel.System.Runtime.Serialization.Json.TypeMap.cs.
in class/System.ServiceModel.Web/System.Runtime.Serialization.Json/:
2009-12-06 Chris Toshok <[email protected]>
* JsonSerializationReader.cs (DeserializeGenericCollection): this
is jb's (iirc) patch, actually. Types subclassing from
ICollection<T> need to be supported, and since it's an interface
the implementation might be explicit. So instead of groveling
around in the actual type, we need to dispatch through the
interface's method.
* TypeMap.cs (CreateDefaultTypeMap): we need to include non-public
properties, since KeyValuePair items must be able to write to Key
and Value properties.
* JsonReader.cs (ReadContent): for builtin values (null, true,
false), use TryReadString instead of individual ReadChar's, since
they aren't reversible if the string didn't match. In the default
case, if we're LameSilverlightLiseralParser, we need to push back
the current character onto the stream -- this is because for
netflix's AppConfig.json we were parsing "frameRatePolicy" as
"rameRatePolicy" (the 'f' was triggering the "false" parsing).
(class PushBackReader): add this class to unify all the pushing
back of characters we need to do. 1 character (JsonReader's old
"saved_char") isn't enough given that you could have a property
named, e.g., "falsifiable", and we'd need 4 characters worth of
pushback to recognize that correctly.
svn path=/trunk/mcs/; revision=147766
* List.cs (Sort): Call more appropriate overload of Array.Sort<T>.
Array.Sort<T> should be able to determine the comparison itself.
Speeds up the sorting for items of primitive type.
Fixes#530450.
svn path=/trunk/mcs/; revision=146704