Mantis - Squeak
Viewing Issue Advanced Details
6367 Collections minor always 03-23-07 00:30 09-15-09 19:16
nicolas cellier  
nicolas cellier  
normal  
closed  
fixed  
none    
none trunk  
0006367: [BUG] WideString substrings broken
| w |
w := WideString with: 401 asCharacter with: $a with: 402 asCharacter with: $b.
self assert: w substrings first = w.
CharacterSet complement does not take WideCharacter into account...
Thus CSNonSeparators String classVar is incomplete...

Possible cure: create a CharacterSetComplement class that handles includes: test as a negation of its characterSet instVar includes:
related to 0007175closed andreas CharacterSetComplement cannot printString 
related to 0005331closed andreas 'abc' beginsWith: 'ab' asWideString (returns wrong result) 
 WideString-substrings-Test.1.cs [^] (661 bytes) 03-23-07 00:46
 WideString-substrings-Patch.1.cs [^] (4,694 bytes) 03-23-07 01:30
 CharacterSetComplement-M6367-nice-hashPatch.1.cs [^] (519 bytes) 11-15-07 20:40
 CharacterSetComplement-M6367-nice-printing.1.cs [^] (1,170 bytes) 11-19-07 22:49
 CharacterSetComplement-M6367-nice-patchCopy.1.cs [^] (979 bytes) 11-19-07 23:37
 CharacterSetComplement-postCopy-M6367-nice.1.cs [^] (703 bytes) 11-19-07 23:59

Notes
(0010463)
nicolas cellier   
03-23-07 01:31   
Test and patch added.
Any volunteer to cross check?
(0011439)
nicolas cellier   
11-15-07 20:42   
Following http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-November/122283.html [^]

find a patch for CharacterSetComplement>>#hash.
(0011447)
nicolas cellier   
11-19-07 22:51   
CharacterSetComplement cannot be printed, because they refuse to #do:
CharacterSetComplement-M6367-nice-printing.1.cs patches this behaviour.
(0011448)
nicolas cellier   
11-19-07 23:35   
CharacterSetComplement when created omit to do a copy.
If complement is futher changed, it will change the original changeSet.
Example:
    | cs1 cs2 |
    cs1 := CharacterSet separators.
    cs2 := cs1 complement.
    cs2 add: Character tab.
    ^cs1 includes: Character tab.

CharacterSetComplement-M6367-nice-patchCopy.1.cs patches this behaviour.
IF AND ONLY IF CharacterSet copy is patched itself
See http://bugs.squeak.org/view.php?id=6777 [^]
(0011450)
nicolas cellier   
11-20-07 00:00   
And of course, #postCopy has to be defined too...
This is CharacterSetComplement-postCopy-M6367-nice.1.cs
(0011569)
Keith_Hodges   
12-17-07 17:39   
"fix begin"
Installer mantis bug: 6367 fix:'WideString-substrings-Patch.1.cs'.
Installer mantis bug: 6367 fix:'CharacterSetComplement-M6367-nice-hashPatch.1.cs'.
Installer mantis bug: 6367 fix:'CharacterSetComplement-M6367-nice-printing.1.cs'.
Installer mantis bug: 6367 fix:'CharacterSetComplement-M6367-nice-patchCopy.1.cs'.
Installer mantis bug: 6367 fix:'CharacterSetComplement-postCopy-M6367-nice.1.cs'.
"fix test"
Installer mantis bug: 6367 fix:'WideString-substrings-Test.1.cs'.
"fix end"
(0012334)
noha   
07-04-08 06:23   
in pharo 10049
(0012566)
KenCausey   
09-01-08 18:04   
http://ftp.squeak.org/updates/7073CollectionAndCollectionTest.cs [^] (for 3.10)

harvests WideString-substrings-Test.1.cs, WideString-substrings-Patch.1.cs, CharacterSetComplement-M6367-nice-hashPatch.1.cs, CharacterSetComplement-M6367-nice-patchCopy.1.cs, and CharacterSetComplement-postCopy-M6367-nice.1.cs

but NOT CharacterSetComplement-M6367-nice-printing.1.cs

*sigh*
(0012570)
nicolas cellier   
09-02-08 07:40   
Since CharacterSetComplement-M6367-nice-printing.1.cs has not been harvested, printString bug is now reported at 0007175
(0012604)
KenCausey   
09-09-08 15:06   
Thank you Nicolas. Most patches harvested with update 7073 and released in 3.10. See 0007175 for followup.
(0013308)
nicolas cellier   
09-15-09 19:14   
Strange, 3 changes were missing in trunk.

CharacterSetComplement-M6367-nice-hashPatch.1.cs
CharacterSetComplement-M6367-nice-patchCopy.1.cs
CharacterSetComplement-postCopy-M6367-nice.1.cs

Fixed in http://source.squeak.org/trunk/Collections-nice.133.mcz [^]