a bug of sort

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

a bug of sort

SeanTAllen
because gemstone's copyReplaceFrom:to:with: silently takes '' as the
with but doesnt do the replacement,
anything that relies on it like... copyReplaceAll:with:asTokens: ends
up in an endless loop if you do something like:

'5,347' copyReplaceAll: ',' with: '' asTokens: false.

Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
you pass it something like ''?
Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

Dale Henrichs
Sean Allen wrote:
> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
> with but doesnt do the replacement,
> anything that relies on it like... copyReplaceAll:with:asTokens: ends
> up in an endless loop if you do something like:
>
> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>
> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
> you pass it something like ''?

Sean,

sounds like a bug to me as well ... could you submit this over on
http://code.google.com/p/glassdb/issues/list...

Thanks,

Dale
Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

Lisa Almarode-2
While I haven't had a moment to look at the
copyReplaceAll:with:asTokens: method, it otherwise sounds like a known
bug, #40550, in which copyReplacefrom:to:with: returned the receiver for
an empty with: argument.  Bug 40550 is fixed in version 2.4.3.

Lisa Almarode
GemStone Technical Support

Dale Henrichs wrote:

> Sean Allen wrote:
>> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
>> with but doesnt do the replacement,
>> anything that relies on it like... copyReplaceAll:with:asTokens: ends
>> up in an endless loop if you do something like:
>>
>> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>>
>> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
>> you pass it something like ''?
>
> Sean,
>
> sounds like a bug to me as well ... could you submit this over on
> http://code.google.com/p/glassdb/issues/list...
>
> Thanks,
>
> Dale

Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

SeanTAllen
When was 2.4.3 released?


On Wed, Jun 2, 2010 at 7:38 PM, Lisa Almarode <[hidden email]> wrote:

> While I haven't had a moment to look at the copyReplaceAll:with:asTokens:
> method, it otherwise sounds like a known bug, #40550, in which
> copyReplacefrom:to:with: returned the receiver for an empty with: argument.
>  Bug 40550 is fixed in version 2.4.3.
>
> Lisa Almarode
> GemStone Technical Support
>
> Dale Henrichs wrote:
>>
>> Sean Allen wrote:
>>>
>>> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
>>> with but doesnt do the replacement,
>>> anything that relies on it like... copyReplaceAll:with:asTokens: ends
>>> up in an endless loop if you do something like:
>>>
>>> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>>>
>>> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
>>> you pass it something like ''?
>>
>> Sean,
>>
>> sounds like a bug to me as well ... could you submit this over on
>> http://code.google.com/p/glassdb/issues/list...
>>
>> Thanks,
>>
>> Dale
>
>
Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

Lisa Almarode-2
GemStone/S 64 Bit was released at the end of April.

There's (finally) a bugnote published for this, with the fix code:
http://support.gemstone.com/gemstone_s/learning_center/bug_notes/GS64/40550.html

Regards
Lisa Almarode



Sean Allen wrote:

> When was 2.4.3 released?
>
>
> On Wed, Jun 2, 2010 at 7:38 PM, Lisa Almarode <[hidden email]> wrote:
>> While I haven't had a moment to look at the copyReplaceAll:with:asTokens:
>> method, it otherwise sounds like a known bug, #40550, in which
>> copyReplacefrom:to:with: returned the receiver for an empty with: argument.
>>  Bug 40550 is fixed in version 2.4.3.
>>
>> Lisa Almarode
>> GemStone Technical Support
>>
>> Dale Henrichs wrote:
>>> Sean Allen wrote:
>>>> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
>>>> with but doesnt do the replacement,
>>>> anything that relies on it like... copyReplaceAll:with:asTokens: ends
>>>> up in an endless loop if you do something like:
>>>>
>>>> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>>>>
>>>> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
>>>> you pass it something like ''?
>>> Sean,
>>>
>>> sounds like a bug to me as well ... could you submit this over on
>>> http://code.google.com/p/glassdb/issues/list...
>>>
>>> Thanks,
>>>
>>> Dale
>>

Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

Dale Henrichs
In reply to this post by SeanTAllen
2.4.3 was releaed at the beginning of May ... I have started work on a
2.4.3.1 that will include 1.0-beta.8...

Dale

Sean Allen wrote:

> When was 2.4.3 released?
>
>
> On Wed, Jun 2, 2010 at 7:38 PM, Lisa Almarode <[hidden email]> wrote:
>> While I haven't had a moment to look at the copyReplaceAll:with:asTokens:
>> method, it otherwise sounds like a known bug, #40550, in which
>> copyReplacefrom:to:with: returned the receiver for an empty with: argument.
>>  Bug 40550 is fixed in version 2.4.3.
>>
>> Lisa Almarode
>> GemStone Technical Support
>>
>> Dale Henrichs wrote:
>>> Sean Allen wrote:
>>>> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
>>>> with but doesnt do the replacement,
>>>> anything that relies on it like... copyReplaceAll:with:asTokens: ends
>>>> up in an endless loop if you do something like:
>>>>
>>>> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>>>>
>>>> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
>>>> you pass it something like ''?
>>> Sean,
>>>
>>> sounds like a bug to me as well ... could you submit this over on
>>> http://code.google.com/p/glassdb/issues/list...
>>>
>>> Thanks,
>>>
>>> Dale
>>


Reply | Threaded
Open this post in threaded view
|

Re: a bug of sort

Dale Henrichs
Dale Henrichs wrote:

> 2.4.3 was releaed at the beginning of May ... I have started work on a
> 2.4.3.1 that will include 1.0-beta.8...
>
> Dale
>
> Sean Allen wrote:
>> When was 2.4.3 released?
>>
>>
>> On Wed, Jun 2, 2010 at 7:38 PM, Lisa Almarode <[hidden email]> wrote:
>>> While I haven't had a moment to look at the copyReplaceAll:with:asTokens:
>>> method, it otherwise sounds like a known bug, #40550, in which
>>> copyReplacefrom:to:with: returned the receiver for an empty with: argument.
>>>  Bug 40550 is fixed in version 2.4.3.
>>>
>>> Lisa Almarode
>>> GemStone Technical Support
>>>
>>> Dale Henrichs wrote:
>>>> Sean Allen wrote:
>>>>> because gemstone's copyReplaceFrom:to:with: silently takes '' as the
>>>>> with but doesnt do the replacement,
>>>>> anything that relies on it like... copyReplaceAll:with:asTokens: ends
>>>>> up in an endless loop if you do something like:
>>>>>
>>>>> '5,347' copyReplaceAll: ',' with: '' asTokens: false.
>>>>>
>>>>> Shouldnt this at least throw an error in copyReplaceFrom:to:with: if
>>>>> you pass it something like ''?
>>>> Sean,
>>>>
>>>> sounds like a bug to me as well ... could you submit this over on
>>>> http://code.google.com/p/glassdb/issues/list...
>>>>
>>>> Thanks,
>>>>
>>>> Dale
>
>
Here's the bugfix....if there is sufficient interest I can make a
1.0-beta.8.1 release with the bugfix, otherwise I'll plan on including a
fix in 1.0-beta.9.

Tracking this with Issue 121
(http://code.google.com/p/glassdb/issues/detail?id=121)

bugfix:

category: 'Copying'
method: SequenceableCollection
copyReplaceFrom: startIndex to: stopIndex with: aSequenceableCollection

"Returns a copy of the receiver in which all elements in the
receiver between indexes startIndex and stopIndex inclusive have
been replaced by those contained in aSequenceableCollection."

| selfSize seqCollSize targetIndex result |
startIndex > stopIndex ifTrue:
[^startIndex _error: #rtErrBadCopyFromTo args: #[stopIndex]].

seqCollSize := aSequenceableCollection size.
result := self species new.
targetIndex := 1.

startIndex > 1 ifTrue:
[self
copyFrom: 1
to: startIndex - 1
into: result
startingAt: targetIndex.
targetIndex := targetIndex + startIndex - 1].

0 < seqCollSize ifTrue: [
aSequenceableCollection
copyFrom: 1
to: seqCollSize
into: result
startingAt: targetIndex.
].
targetIndex := targetIndex + seqCollSize.

selfSize := self size.
stopIndex < selfSize ifTrue:
[self
copyFrom: stopIndex + 1
to: selfSize
into: result
startingAt: targetIndex].

^result
%

Dale