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