Mantis - Squeak
Viewing Issue Advanced Details
6579 Collections minor always 07-27-07 20:25 04-18-10 22:04
nicolas cellier  
nicolas cellier  
normal  
closed 3.9  
fixed  
none    
none trunk  
0006579: String>>#findLastOccuranceOfString:startingAt: isBuggedWhen: [substring first=substring last]

assert: ('ababa' findLastOccuranceOfString: 'aba' startingAt: 1) = 3
Current algorithm find aba at: 1, then restart search at: 4, thus never find 3...

minimal example:

assert: ('aaa' findLastOccuranceOfString: 'aa' startingAt: 1) = 2
related to 0006366closed andreas [BUG] WideString findString:startingAt: and other matchTable problems 

Notes
(0013245)
nicolas cellier   
08-22-09 22:08   
Serge Stinckwich posted a fix in pharo at
http://code.google.com/p/pharo/issues/detail?id=1019 [^]
(0013246)
robert_krahn   
08-23-09 00:23   
Proposal for a fix: http://source.squeak.org/inbox/Collections-rkrk.117.mcz [^] (replacing subString size with 1)
Test: http://source.squeak.org/tests/CollectionsTests-rkrk.90.mcz [^]
(0013247)
robert_krahn   
08-23-09 00:24   
Oops, saw note #1 first after posting.
(0013256)
nicolas cellier   
08-24-09 19:21   
That does not much matter, your solutions are the same.
However note that Serge also renamed Occurance -> Occurence
The right way to do that is to deprecate the old selector after adding the new one.
(0013340)
nicolas cellier   
10-05-09 01:36   
Note that both serge and robert changes are in conflict with 0006366, and I had to merge the corrections.