GsDevKit / glassdb

Automatically exported from code.google.com/p/glassdb
0 stars 0 forks source link

SortedCollection does not agree with Sequencable collection #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. (SortedCollection with: 'a' with: 'b') copyWith: 'c' 
doit.

What is the expected output? What do you see instead?
* should be a sorted collection with a, b, and c.
* An error is thrown, #rtErrShouldNotImplement.
Because:
SortedCollection>>addLast: is shouldNotImplement.
but
SequencableCollection>>copyWith: does (self copy) addLast:

What version of the product are you using? On what operating system?
GLASS-1.0-beta.3

Please provide any additional information below.

Magritte Relies on a well-behaving 'copyWith:'.

Fix: implement in SortedCollection:
copyWith: anObject
    "Returns a copy of the receiver with anObject added. 
    This does not use #addLast: as my super SequenceableCollection."

    ^ (self copy)
        add: anObject;
        yourself.

Original issue reported on code.google.com by tobiasp...@gmail.com on 27 Apr 2010 at 10:56

GoogleCodeExporter commented 9 years ago

Original comment by henrichs...@gmail.com on 23 Mar 2011 at 11:15

GoogleCodeExporter commented 9 years ago
Looks like the bug was fixed in June of 2010 ... and the copyWith: method was 
added to OrdedCollection...

Original comment by henrichs...@gmail.com on 23 Mar 2011 at 11:38