[Mono-bugs] [Bug 73417][Nor] New - Array.Sort() does not sort correctly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 7 Mar 2005 02:17:28 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by michi@zeroc.com.

http://bugzilla.ximian.com/show_bug.cgi?id=73417

--- shadow/73417	2005-03-07 02:17:28.000000000 -0500
+++ shadow/73417.tmp.19208	2005-03-07 02:17:28.000000000 -0500
@@ -0,0 +1,136 @@
+Bug#: 73417
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: michi@zeroc.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Array.Sort() does not sort correctly
+
+Running Mono under Windows, Array.Sort() does not sort correctly.
+
+Run the following code:
+
+ private static string[] __all =
+ {
+     "D1AsB",
+     "D1AsD1",
+     "D2AsB",
+     "dictionaryTest",
+     "ice_id",
+     "ice_ids",
+     "ice_isA",
+     "ice_ping",
+     "oneElementCycle",
+     "paramTest1",
+     "paramTest2",
+     "paramTest3",
+     "paramTest4",
+     "returnTest1",
+     "returnTest2",
+     "returnTest3",
+     "SBaseAsObject",
+     "SBaseAsSBase",
+     "SBSKnownDerivedAsSBase",
+     "SBSKnownDerivedAsSBSKnownDerived",
+     "SBSUnknownDerivedAsSBase",
+     "sequenceTest",
+     "shutdown",
+     "SUnknownAsObject",
+     "throwBaseAsBase",
+     "throwDerivedAsBase",
+     "throwDerivedAsDerived",
+     "throwUnknownDerivedAsBase",
+     "twoElementCycle",
+     "useForward"
+ };
+
+ _System.Array.Sort(_all, 0, _all.Length, 
+System.Collections.Comparer.DefaultInvariant);
+ foreach(string s in _all)
+ {
+     System.Console.WriteLine(s);
+ }
+
+Compiling and running this code with Mono under Windows, I get the 
+following order:
+
+D1AsB
+D1AsD1
+D2AsB
+SBSKnownDerivedAsSBSKnownDerived
+SBSKnownDerivedAsSBase
+SBSUnknownDerivedAsSBase
+SBaseAsObject
+SBaseAsSBase
+SUnknownAsObject
+dictionaryTest
+ice_id
+ice_ids
+ice_isA
+ice_ping
+oneElementCycle
+paramTest1
+paramTest2
+paramTest3
+paramTest4
+returnTest1
+returnTest2
+returnTest3
+sequenceTest
+shutdown
+throwBaseAsBase
+throwDerivedAsBase
+throwDerivedAsDerived
+throwUnknownDerivedAsBase
+twoElementCycle
+useForward
+
+Compiling the code with Visual Studio C# and .NET 1.1, I get:
+
+D1AsB
+D1AsD1
+D2AsB
+dictionaryTest
+ice_id
+ice_ids
+ice_isA
+ice_ping
+oneElementCycle
+paramTest1
+paramTest2
+paramTest3
+paramTest4
+returnTest1
+returnTest2
+returnTest3
+SBaseAsObject
+SBaseAsSBase
+SBSKnownDerivedAsSBase
+SBSKnownDerivedAsSBSKnownDerived
+SBSUnknownDerivedAsSBase
+sequenceTest
+shutdown
+SUnknownAsObject
+throwBaseAsBase
+throwDerivedAsBase
+throwDerivedAsDerived
+throwUnknownDerivedAsBase
+twoElementCycle
+useForward
+
+Note that identifiers starting with an upper-case letter are collated 
+differently.
+
+Cheers,
+
+Michi.