[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


           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.


1) MonoTests.System.Collections.Generic.DictionaryTest.IterateAfterClear :
System.InvalidOperationException : Current is not valid
() [0x00000] 
() [0x00000] 
  at MonoTests.System.Collections.Generic.DictionaryTest.IterateAfterClear ()
[0x00028] in
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00057] in

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