зеркало из https://github.com/mono/mail-archives.git
267 строки
8.3 KiB
HTML
267 строки
8.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-bugs] [Bug 483985] New: Wrong behavior of generic SortedList compared to .Net behavior
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20483985%5D%20New%3A%20Wrong%20behavior%20of%20generic%20SortedList%0A%20compared%20to%20.Net%20behavior&In-Reply-To=">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="087047.html">
|
|
<LINK REL="Next" HREF="086877.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-bugs] [Bug 483985] New: Wrong behavior of generic SortedList compared to .Net behavior</H1>
|
|
<B>bugzilla_noreply at novell.com</B>
|
|
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20483985%5D%20New%3A%20Wrong%20behavior%20of%20generic%20SortedList%0A%20compared%20to%20.Net%20behavior&In-Reply-To="
|
|
TITLE="[Mono-bugs] [Bug 483985] New: Wrong behavior of generic SortedList compared to .Net behavior">bugzilla_noreply at novell.com
|
|
</A><BR>
|
|
<I>Tue Mar 10 12:39:01 EDT 2009</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="087047.html">[Mono-bugs] [Bug 483950] Console.In.ReadLine doesn't deal with EOF
|
|
</A></li>
|
|
<LI>Next message: <A HREF="086877.html">[Mono-bugs] [Bug 483985] Wrong behavior of generic SortedList compared to .Net behavior
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#86870">[ date ]</a>
|
|
<a href="thread.html#86870">[ thread ]</a>
|
|
<a href="subject.html#86870">[ subject ]</a>
|
|
<a href="author.html#86870">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=483985">https://bugzilla.novell.com/show_bug.cgi?id=483985</A>
|
|
|
|
|
|
Summary: Wrong behavior of generic SortedList compared to .Net
|
|
behavior
|
|
Classification: Mono
|
|
Product: Mono: Class Libraries
|
|
Version: SVN
|
|
Platform: All
|
|
OS/Version: All
|
|
Status: NEW
|
|
Severity: Normal
|
|
Priority: P5 - None
|
|
Component: System
|
|
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
|
|
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">tquerci at gmail.com</A>
|
|
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
|
|
Found By: ---
|
|
|
|
|
|
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; it; rv:1.9.0.7)
|
|
Gecko/2009022800 SUSE/3.0.7-1.2 Firefox/3.0.7
|
|
|
|
Hi,
|
|
|
|
the behavior of generic SortedList between .Net and Mono are different.
|
|
In depth when you use enumerator from Keys and Values you are able to remove an
|
|
element from the sorted list and go on in the enumerator without have any
|
|
exception. Moreover you not able to reset the enumerator where is possible on
|
|
Net.
|
|
|
|
THis behavior is tested on VS C# Express
|
|
|
|
Changes on UnitTest are also provided.
|
|
|
|
|
|
|
|
Reproducible: Always
|
|
|
|
Steps to Reproduce:
|
|
// This code show the bug
|
|
// The only exception that need to be generated is capture.
|
|
// If you run this application without fix you got a uncaptured exception
|
|
//
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace SortedListTest
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
SortedList<String, String> contents = new SortedList<string,
|
|
string>();
|
|
int i;
|
|
|
|
contents.Add("key 01", "key 01");
|
|
contents.Add("key 02", "key 02");
|
|
contents.Add("key 03", "key 03");
|
|
contents.Add("key 04", "key 04");
|
|
contents.Add("key 05", "key 05");
|
|
contents.Add("key 06", "key 06");
|
|
contents.Add("key 07", "key 07");
|
|
contents.Add("key 08", "key 08");
|
|
contents.Add("key 09", "key 09");
|
|
contents.Add("key 10", "key 10");
|
|
|
|
IEnumerator<string> en = contents.Keys.GetEnumerator();
|
|
string key;
|
|
System.Console.Out.WriteLine("CHECK FOR REMOVE KEY IN THE
|
|
SortedList----------------");
|
|
try
|
|
{
|
|
|
|
i = 0;
|
|
while (en.MoveNext())
|
|
{
|
|
key = en.Current;
|
|
System.Console.Out.Write("Key=" + key);
|
|
if (i == 4)
|
|
{
|
|
contents.Remove(key);
|
|
System.Console.Out.Write("\tdeleted");
|
|
}
|
|
|
|
System.Console.Out.WriteLine("");
|
|
i++;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
System.Console.Out.WriteLine("Exception:
|
|
"+ex.GetType().ToString()+" - "+ex.Message);
|
|
}
|
|
|
|
System.Console.Out.WriteLine("");
|
|
System.Console.Out.WriteLine("CHECK FOR RESET KEY ENUMERATOR IN THE
|
|
SortedList----------------");
|
|
en = contents.Keys.GetEnumerator();
|
|
i=0;
|
|
while (en.MoveNext())
|
|
{
|
|
key = en.Current;
|
|
System.Console.Out.WriteLine("Key=" + key+" present");
|
|
if (i==4) {
|
|
en.Reset();
|
|
}
|
|
i++;
|
|
}
|
|
|
|
IEnumerator<string> env = contents.Values.GetEnumerator();
|
|
string val;
|
|
|
|
System.Console.Out.WriteLine("========================================================");
|
|
System.Console.Out.WriteLine("CHECK FOR REMOVE VALUE IN THE
|
|
SortedList----------------");
|
|
try
|
|
{
|
|
|
|
i = 0;
|
|
while (env.MoveNext())
|
|
{
|
|
val = env.Current;
|
|
System.Console.Out.Write("Value=" + val);
|
|
if (i == 4)
|
|
{
|
|
contents.RemoveAt(i);
|
|
System.Console.Out.Write("\tdeleted");
|
|
}
|
|
|
|
System.Console.Out.WriteLine("");
|
|
i++;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
System.Console.Out.WriteLine("Exception:
|
|
"+ex.GetType().ToString()+" - "+ex.Message);
|
|
}
|
|
|
|
System.Console.Out.WriteLine("");
|
|
System.Console.Out.WriteLine("CHECK FOR RESET VALUE ENUMERATOR IN
|
|
THE SortedList----------------");
|
|
env = contents.Keys.GetEnumerator();
|
|
i=0;
|
|
while (env.MoveNext())
|
|
{
|
|
val = env.Current;
|
|
System.Console.Out.WriteLine("value=" + val+" present");
|
|
if (i==4) {
|
|
env.Reset();
|
|
}
|
|
i++;
|
|
}
|
|
|
|
System.Console.In.ReadLine();
|
|
}
|
|
}
|
|
}
|
|
|
|
--
|
|
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
|
|
------- You are receiving this mail because: -------
|
|
You are the QA contact for the bug.
|
|
You are the assignee for the bug.
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="087047.html">[Mono-bugs] [Bug 483950] Console.In.ReadLine doesn't deal with EOF
|
|
</A></li>
|
|
<LI>Next message: <A HREF="086877.html">[Mono-bugs] [Bug 483985] Wrong behavior of generic SortedList compared to .Net behavior
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#86870">[ date ]</a>
|
|
<a href="thread.html#86870">[ thread ]</a>
|
|
<a href="subject.html#86870">[ subject ]</a>
|
|
<a href="author.html#86870">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
|
|
mailing list</a><br>
|
|
</body></html>
|