fixed tests
[mono.git] / mcs / class / corlib / System.Collections.Generic / ChangeLog
1 2006-09-15  Gert Driesen  <drieseng@users.sourceforge.net>
2
3         * List.cs: Fixed binary serialization compatibility with MS.NET.
4         Increment version whenever _items is modified; this fixes version
5         checks in Enumerator.
6
7 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
8
9         * Dictionary.cs: Speed up get_Item/set_Item/GetPrev () a bit. Increase capacity
10         specified by the user so 'capacity' elements can really be added without resizing.
11
12 2006-07-12  Zoltan Varga  <vargaz@gmail.com>
13
14         * Dictionary.cs: Swap order of parameters to cmp.Equals () to improve 
15         compatibility with MS.NET and strange Equals () implementations.        
16
17 2006-05-17  Kazuki Oikawa  <kazuki@panicode.com>
18
19         * List.cs : implemented Sort(Comparison <T>).
20
21 2006-05-08  Atsushi Enomoto  <atsushi@ximian.com>
22
23         * List.cs : use proper comparer in Contains(), IndexOf() and
24           LastIndexOf(). Patch by Kazuki Oikawa. Fixed bug #77277.
25
26 2006-03-16  Ankit Jain  <jankit@novell.com>
27
28         * List.cs (CheckIndex): Check for -ve indices and allow index == size.
29         (Insert): Use CheckIndex.
30
31 2006-03-12  Zoltan Varga  <vargaz@gmail.com>
32
33         * List.cs: Applied patch from <kazuki@panicode.com>. Fixes #77504.
34
35 2006-02-10  Martin Baulig  <martin@ximian.com>
36
37         * Comparer.cs
38         (IComparableOfTComparer): `T' must implement `IComparable<T>' and
39         not `IComparable'.
40
41 Tue Jan 24 18:22:54 CET 2006 Paolo Molaro <lupus@ximian.com>
42
43         * Dictionary.cs: avoid long reminder operations.
44
45 2006-01-23  Raja R Harinath  <rharinath@novell.com>
46
47         Speed up remove.  Use 'dict[k]=v' as a self-tuning hint.
48         * Dictionary.cs (GetSlot): Move data-structure traversal to ...
49         (GetPrev): ... this.  Returns the slot prior to the place we're
50         looking for, or null if that place is the head of the chain.
51         (Remove): Use it.
52         (this.set): Use it.  Implement move-to-front on set.
53
54         * Dictionary.cs (ToTKey, ToTValue): New helpers to convert from
55         type 'object'.
56         (IDictionary.this, IDictionary.Add): Use them.
57         (IDictionary.Contains, IDictionary.Remove): If the types don't
58         match, do nothing.
59
60 2006-01-19  Raja R Harinath  <rharinath@novell.com>
61
62         Fix to pass new nunit tests.
63         * Dictionary.cs (ShimEnumerator): New class.  Implement the
64         requirement that ((IDictionary) foo).GetEnumerator ().Current has
65         type DictionaryEntry.
66         (IDictionary.GetEnumerator): Use ShimEnumerator.
67         (Enumerator.Current): Now has type KeyValuePair<TKey, TValue>.
68         (Enumerator.MoveNext): Use VerifyState.
69         (Enumerator.VerifyState): Move validation of 'current' field to ...
70         (Enumerator.CurrentSlot): ... this.
71         (Enumerator.Current, Enumerator.IDictionaryEnumerator.Entry):
72         Use CurrentSlot.
73         (CopyTo, ICollection.CopyTo): Use subtle reasoning to replace a
74         '>=' with a '>'.  Don't throw an ArgumentException when
75         index==array.Length && Count==0.
76         (KeyCollection.CopyTo, ValueCollection.CopyTo): Likewise, and thus
77         obviate the need to check (dictionary.Count == 0).
78
79 2005-12-20  Sebastien Pouliot  <sebastien@ximian.com>
80
81         * List.cs: Applied Atsushi's patch for Sort (bug 76361) now that the
82         generic versions of Array.Sort are implemented.
83
84 2005-12-19  Sebastien Pouliot  <sebastien@ximian.com>
85
86         * Dictionary.cs: Added [Serializable] attribute to both inner 
87         Enumerator struct in Key and Value inner collection classes.
88         * EqualityComparer.cs: Added missing IEqualityComparer interface.
89         * List.cs: Added [Serializable] attribute to both inner Enumerator
90         struct.
91
92 2005-12-19  Sebastien Pouliot  <sebastien@ximian.com> 
93  
94         * Dictionary.cs: Fixed ICollection.CopyTo to use DictionaryEntry. Fixed
95         Key and Value CopyTo not to throw exception if the dictionary is empty
96         (fix bug #77019).
97         * List.cs: Fix exception reporting to match MS behaviour (2.0 final).
98
99 2005-11-19  Zoltan Varga  <vargaz@gmail.com>
100
101         * KeyNotFoundException.cs: Add default message.
102
103 2005-09-18  Miguel de Icaza  <miguel@novell.com>
104
105         * Dictionary.cs: Change style for internal fields.
106
107         If the capacity is zero, set the capacity to our default size as 0
108         is an allowed parameter in .NET
109
110 2005-08-10  Kamil Skalski  <nazgul@nemerle.org>
111
112         * KeyValuePair.cs, Dictionary.cs: Change Key and Value to properties to match
113         .NET 2.0 July CTP. Update its use in Dictionary, since now we
114         cannot write to them.
115         
116 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
117
118         * Comparer.cs, EqualityComparer.cs: Use MakeGenericType instead of BindGenericParameters.
119
120
121 2005-06-27  Raja R Harinath  <rharinath@novell.com>
122
123         Introduce some thread-safety by removing the modify-on-read
124         move-to-front heuristic.
125         * Dictionary.cs (_enumeratorGeneration, _enumerators): Remove.
126         (Count): Add internal property set.  Invalidate enumerators when
127         Count is changed.  Change all references of _usedSlots to Count.
128         (this): Invalidate enumerators when the value of some slot is
129         changed, even if the layout of the data-structure isn't modified.
130         (DoHash): Remove null-key check.  All codepaths leading to this
131         function already have the check.
132         (GetSlot): Remove move-to-front heuristic.
133         (Remove): Update.
134
135 2005-06-24  Martin Baulig  <martin@ximian.com>
136
137         * IDictionary.cs: Use the same type parameter names than on MS.
138
139         * IDictionary.cs, Dictionary.cs: We don't need the `CLSCompliant'
140         attribute here.
141
142 2005-06-23  Martin Baulig  <martin@ximian.com>
143
144         * *.cs: Removed the `[ComVisible(false)]' attributes everywhere.
145
146 2005-06-22  Raja R Harinath  <rharinath@novell.com>
147
148         * Dictionary.cs (_generation, _enumeratorGeneration, _enumerators):
149         New fields to implement fail-fast semantics.  All code that
150         modifies the table increment _generation.
151         (GetSlot): Use _hcp to compare keys.  Return the slot containing
152         the key, rather than the index.  Avoid move-to-front heuristic
153         when there's an enumerator coursing through the table.
154         (this, Add, TryGetValue, ContainsKey, Remove): Update to change.
155         (Enumerator.Enumerator): Save the generation of the dictionary.
156         (Enumerator.Dispose): Inform dictionary that the enumerator is no more.
157         (Enumerator.MoveNext, Enumerator.VerifyState): Fail if the
158         dictionary has been modified.
159
160 2005-06-20  David waite  <mass@akuma.org>
161
162         * List.cs : substantial changes and optimizations
163         (AddCollection, AddEnumerable): new internal specializations of AddRange
164         (AsReadOnly): returns specific IList<T> to match ms.net 2.0b2 api.
165         (Clear): reset size to zero on clear
166         (ConvertAll): catch null converter, use Add to prevent OutOfBounds
167         exception
168         (FindAll, FindIndex, FindLast, FindLastIndex, RemoveAll, TrueForAll): 
169         check for null match
170         (FindLastIndex): correct index parameters based on ms.net 2005b2 behavior
171         (ForEach): catch null action
172         (CheckIndex): new internal function similar to CheckRange for functions
173         which only provide a starting index
174         (InsertCollection, InsertEnumerable): new internal specializations of
175         InsertRange
176         (ReadOnlyList): removed, ReadOnlyCollection in 
177         System.Collections.ObjectModel is used instead now 
178     
179 2005-06-16  David Waite  <mass@akuma.org>
180
181         * Dictionary.cs (EnumerationMode): Remove.
182         (Enumerator): Remove return type flag - legacy return is expected to
183         always return a DictionaryEntry
184         (Enumerator): Make constructor internal, it is not public on ms.net 
185         beta 2
186         (VerifyState): Added method to check state preconditions and throw
187         appropriate exceptions.
188         (KeyCollection,ValueCollection): Mark sealed to match ms.net beta 2
189         (KeyCollection.Enumerator._hostEnumerator): make exact struct type,
190         rather than boxing and using by interface
191         (KeyCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
192         (ValueCollection.Enumerator._hostEnumerator): make exact struct type,
193         rather than boxing and using by interface
194         (ValueCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
195         * EqualityComparer.cs (DefaultComparer, IEquatableOfTEqualityComparer):
196         Mark as serializable.
197
198 2005-06-16  Raja R Harinath  <rharinath@novell.com>
199
200         * Dictionary.cs (GetKeys, GetValues): Remove.
201         (SetThreshold): New function to calculate the resize threshold.
202         (CopyTo): Don't use foreach syntax.
203         (ContainsValue): Likewise.  Use default equality comparer of the
204         value type.
205         (GetObjectData): Use CopyTo to copy into temporary array.  Don't
206         save redundant _usedSlots and _threshold.
207         (OnDeserialization): Rewrite.
208         (ICollection<>.CopyTo): Forward to CopyTo.
209         (Enumerator._nextIndex): Rename to from _index.
210         (Enumerator._next, Enumerator.FixNext): Remove.
211         (Enumerator.Current): Rewrite to avoid need for _next.
212         (Enumerator.IEnumerator.Reset): Update.
213         (KeyCollection): Is also IEnumerable<TKey> and IEnumerable.
214         Update methods to conform to standard.
215         (KeyCollection.GetEnumerator): Restore.  Return the correct type.
216         (KeyCollection.Enumerator): Rename from KeyEnumerator.  Simple
217         wrapper that forwards to Dictionary<,>.Enumerator.
218         (ValueCollection): Likewise.
219
220 2005-06-12  David Waite  <dwaite@gmail.com>
221
222         * IKeyComparer.cs: removed
223         * KeyValuePair.cs: add same-style ToString as ms.net Beta2 impl,
224         make Serializable, use correct field names.
225         * Dictionary.cs: Miscelaneus clean-ups, added serialization
226         support, use Hashtable prime functions
227
228 2005-06-12  Ben Maurer  <bmaurer@ximian.com>
229
230         * Comparer.cs, EqualityComparer.cs: Important performance hack:
231         make sure that we don't box stuff and do reflection on every
232         comparison. We use reflection at cctor time rather than on every
233         request.
234
235 2005-06-09  Raja R Harinath  <rharinath@novell.com>
236
237         Simplify Enumerator.MoveNext to make it "obviously correct", rather
238         than require subtle reasoning about the state of various variables.
239         * Dictionary.cs (Enumerator._isValid): Remove.  Replace all uses
240         with "_current == null".
241         (Enumerator._validNodeVisited): Remove.
242         (Enumerator._next): New.  Holds the the next position.
243         (Enumerator.FixNest): New helper function that ensures that _next
244         has the right value.
245         (Enumerator.MoveNext): Simplify.  Now, copies _next to _current
246         and advances _next if possible.
247
248 2005-06-08  Martin Baulig  <martin@ximian.com>
249
250         * Dictionary.cs (Dictionary.KeyEnumerator): Removed the public
251         GetEnumerator() function since it's returning the wrong type.
252         (Dictionary.ValueEnumerator): Likewise.  Fix #75073.
253
254 2005-06-08  Ankit Jain <ankit@corewars.org>
255
256         * Dictionary.cs (Dictionary<TKey, TValue>.MoveNext): Allow traversal of chain in last slot
257         of the table. Fixes #75168.
258
259 2005-06-04  Ben Maurer  <bmaurer@ximian.com>
260
261         * *.cs: 2.0 api fixups
262
263 2005-05-26  Miguel de Icaza  <miguel@novell.com>
264
265         * Dictionary.cs: Remove the `Hash' name from the Dictionary
266         internal classes, make them public.
267
268 2005-05-26  Zoltan Varga  <vargaz@freemail.hu>
269
270         * Dictionary.cs: Fix a warning.
271
272         * IDictionary.cs: Add missing TryGetValue method.
273
274 2005-05-19  Geoff Norton  <gnorton@customerdna.com>
275
276         * List.cs (Insert): Resize the array before the shift if needed
277
278 2005-05-18  Miguel de Icaza  <miguel@novell.com>
279
280         * List.cs (GetRange): Implement.
281
282         Do not do lazy loading of data.  Not worth adding an
283         extra check, and not worth the bugs. 
284
285         This decision wont be discussed until: a) a full List regression
286         test suite exists and  b) performance benchmarks are created.  (b)
287         depends on (a) or the argument wont even be heard. 
288
289 2005-05-13  Atsushi Enomoto  <atsushi@ximian.com>
290
291         * Queue.cs, Stack.cs: moved to System.dll
292
293 2005-05-06  Martin Baulig  <martin@ximian.com>
294
295         * *.cs: Add CLSCompliant(true) where missing.
296
297 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
298
299         * *.cs: Remove CLSCompliant(false) attributes.
300
301 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
302
303         * List.cs: Applied patch from Mart Roosmaa (roosmaa@gmail.com). 
304         Fix Insert method. Fixes #74824.
305
306 2005-04-29  Martin Baulig  <martin@ximian.com>
307
308         Reflect latest spec changes.
309
310         * IEnumerable.cs (IEnumerable<T>): Implement IEnumerable.
311         * IEnumerator.cs (IEnumerator<T>): Implement IEnumerator.
312
313 2005-04-29  Raja R Harinath  <rharinath@novell.com>
314
315         Remove FIXME.
316         * Dictionary.cs (Slot<K,V>): Move to ...
317         (Dictionary<K,V>.Slot): ... here.
318
319 2005-04-28  Martin Baulig  <martin@ximian.com>
320
321         * Dictionary.cs, Queue.cs, Stack.cs, List.cs, Comparer.cs: Don't
322         duplicate type parameters in the nested classes.
323
324 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
325
326         * List.cs: Fix ToArray () method. Fixes #74675.
327
328 2005-04-04  Raja R Harinath  <rharinath@novell.com>
329
330         * Dictionary.cs: Update to draft of Feb 27.  Add some argument checks.
331         (GetSlot): Don't throw KeyNotFoundException.  Unify all list
332         traversals in here.  Move found key to head of chain, and return
333         the index of the chain suitable for/containing the key.
334         (Item, Add, Remove): Simplify, and remove FIXMEs.
335         (Resize): Reuse linked list nodes from old table.
336         (Dictionary.CopyTo, HashKeyCollection.CopyTo, HashValueCollection.CopyTo):
337         Add some argument checks.
338
339 2005-04-02  Ben Maurer  <bmaurer@ximian.com>
340
341         * Dictionary.cs: Real impl.
342
343 2005-02-21  Martin Baulig  <martin@ximian.com>
344
345         * IComparer.cs: Reverted the last change here, Equals() and
346         GetHashCode() have been removed a long time ago.
347
348 2005-02-21  Kazuki Oikawa  <kazuki@panicode.com>
349
350         * IComparer.cs, IDictionary.cs: Corrected the wrong declaration.
351
352 2005-02-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
353
354         * List.cs: Added internal ReadOnlyCollection class,
355         which is a wrapper for a read only IList<T> version of the List<T>.
356         Used in AsReadOnly () method.
357         
358 2005-02-07  Ben Maurer  <bmaurer@ximian.com>
359
360         * List.cs (CheckRange): Comparison error. Duh!
361         (Shift): really deal with neg. delta. Also, adjust the `size'.
362
363         Based on a patch from Marc Denty (marc.denty@libertysurf.fr).
364
365         Fixes #72258.
366
367 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
368
369         * Queue.cs: `duh' bugs.
370
371 2004-12-27  Ben Maurer  <bmaurer@ximian.com>
372
373         * Stack.cs: Stupid bug fixes.
374
375         * List.cs: My new (mostly untested ;-) impl of List
376         <T>. Implements most of the API.
377
378 2004-12-26  Ben Maurer  <bmaurer@ximian.com>
379
380         * Queue.cs: New, non-linked-list based impl.
381
382 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
383
384         * Comparer.cs: Update this class.
385
386 2004-11-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
387
388         * List.cs: Enumerator changed to behave like the MS impl.
389         
390 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
391
392         * Stack.cs: New, list based impl. Waiting for some gmcs fixes.
393
394 2004-11-10  Martin Baulig  <martin@ximian.com>
395
396         * IDictionary.cs (IDictionary): `IsReadOnly' and `Clear' are
397         inherited from ICollection.
398
399 2004-09-20  Gert Driesen <drieseng@users.sourceforge.net>
400
401         * ReadOnlyCollection.cs: Moved to System assembly
402         * Collection.cs: Moved to System assembly
403
404 2004-09-07  Carlos Alberto Cortez <carlos@unixmexico.org>
405
406         * ReadOnlyCollection.cs: New file and changes to 
407         Collection.cs tu support it.
408
409 2004-09-05  Marek Safar <marek.safar@seznam.cz>
410
411         * Dictionary.cs: Added new file (no implementation).
412
413 2004-09-03  Carlos Alberto Cortez <carlos@unixmexico.org>
414
415         * Collection.cs: Small improvements related to
416         style, resizing, and type checking.
417
418 2004-09-01  Carlos Alberto Cortez <carlos@unixmexico.org>
419
420         * Collection.cs: New file.
421
422 2004-08-04  Martin Baulig  <martin@ximian.com>
423
424         * List.cs (List<T>.Enumerator): Made this a struct.
425         (List<T>.GetEnumerator): The public method now returns the
426         `Enumerator' struct.
427
428 2004-08-02  Martin Baulig  <martin@ximian.com>
429
430         Started to do some API review.
431
432         * ICollection.cs (ICollection<T>): Added IsReadOnly, Add, Clear,
433         Contains and Remove.
434
435         * IList.cs (IList<T>): Removed Add, Clear, Constains, Remove,
436         IsReadOnly and IsFixedSize.
437
438 2004-08-02  Martin Baulig  <martin@ximian.com>
439
440         * IList.cs (IList.Add): Changed return type to void.
441
442         * List.cs (List.Add): Likewise.
443
444 2004-07-16  Martin Baulig  <martin@ximian.com>
445
446         * IComparable.cs: Removed, it's in System.
447
448 2004-07-12  Duncan Mak  <duncan@ximian.com>
449
450         * KeyNotFoundException.cs: Added.
451
452 2004-06-18  Ben Maurer  <bmaurer@ximian.com>
453
454         * Comparer.cs: v2 impl. Some workarounds for gmcs are enabled.
455
456 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
457
458         * Queue.cs: Fixed possible integer overflow in CopyTo methods.
459         * Stack.cs: Fixed possible integer overflow in CopyTo methods.
460
461 2004-03-13  Martin Baulig  <martin@ximian.com>
462
463         * Stack.cs, Queue.cs, List.cs: Implement the non-generic interfaces.
464
465 2004-03-11  Martin Baulig  <martin@ximian.com>
466
467         * List.cs: New file.
468
469 2004-03-11  Martin Baulig  <martin@ximian.com>
470
471         * Stack.cs, Queue.cs: Just use `Node' for the nested class, not
472         `Node<T>' (which would create another type parameter `T'
473         overriding `T' from the outer class).   
474
475 2004-02-23  Martin Baulig  <martin@ximian.com>
476
477         * Stack.cs, Queue.cs: New files.  Hmm, looks like I forgot to add
478         them to CVS; they're already on my hard disk since December or so.
479
480 2003-12-08  Martin Baulig  <martin@ximian.com>
481
482         * *.cs: require GENERICS.
483
484 2003-11-08 Ben Maurer  <bmaurer@users.sourceforge.net>
485
486         * *.cs: require NET_2_0 and GENERICS
487
488 2003-11-07 Ben Maurer  <bmaurer@users.sourceforge.net>
489
490         * IComparable.cs, IComparer.cs, IDictionary.cs, IKeyComparer.cs, KeyValuePair.cs
491         Added.
492
493 2003-11-06  Martin Baulig  <martin@ximian.com>
494
495         * ICollection.cs, IList.cs, IEnumerator.cs, IEnumerable.cs:
496         Started to implement the System.Collections.Generic classes.
497