[Mono-bugs] [Bug 432441] New: Dictionary can't be iterated after Clear() anymore

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Oct 5 22:39:29 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=432441


           Summary: Dictionary can't be iterated after Clear() anymore
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mono at e-tobi.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


When trying to iterate a Dictionary after Clear(), an exception is thrown (see
below). I can iterate an empty Dictionary directly after creating it, but not
after emptying a Dictionary with Clear().

(For some strange reason, I can reproduce this problem only with NUnit, not in
a normal executable.)

I've attached a patch that adds a test case.

Tobias

Failures:
1) MonoTests.System.Collections.Generic.DictionaryTest.IterateAfterClear :
System.InvalidOperationException : Current is not valid
  at
System.Collections.Generic.Dictionary`2+Enumerator[System.Object,System.Object].VerifyCurrent
() [0x00000] 
  at
System.Collections.Generic.Dictionary`2+Enumerator[System.Object,System.Object].get_Current
() [0x00000] 
  at MonoTests.System.Collections.Generic.DictionaryTest.IterateAfterClear ()
[0x00028] in
/home/tobias/sandbox/x/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs:888 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00057] in
/home/tobias/sandbox/x/mcs/class/corlib/System.Reflection/MonoMethod.cs:159


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list