Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002273 [Squeak] Collections minor always 11-28-05 21:29 09-08-08 14:58
Reporter thams View Status public  
Assigned To
Priority normal Resolution fixed  
Status closed   Product Version 3.9
Summary 0002273: PositionableStream >>isEmpty retuns wrong result
Description Implemented as:
isEmpty
    "Answer whether the receiver's contents has no elements.
    ^position = 0

Should be:
isEmpty
    "Answer whether the receiver's contents has no elements."
    ^collection size = 0

But fixing this exposes a bug in ParagraphEditor >>backspace:
(This can be immediately demonstrated by typing the backspace key in any ParagraphEditor after making the above repair).

Proposed fixes for both are provided in the attached filein.
Additional Information
Attached Files  bugfixes-ktt.1.cs [^] (799 bytes) 11-28-05 21:29
 PositionableStream-isEmpty.1.cs [^] (1,383 bytes) 02-27-07 16:28
 PositionableStream-isEmpty.2.cs [^] (1,795 bytes) 02-27-07 16:59

- Relationships
parent of 0006409closed wiz in 7081 :7076fixPositionableStream-isEmpty.1.cs was wrong fix. Prettyprint broken by it. 

- Notes
(0010228 - 196 - 196 - 196 - 196 - 196 - 196)
Damien Cassou
02-27-07 16:26

I found it again. And I fixed it too :-) However, I don't see the problem with ParagraphEditor. In my fix, there are 3 tests (one for ReadStream, one for WriteStream, and one for ReadWriteStream).
 
(0010230 - 43 - 43 - 43 - 43 - 43 - 43)
Damien Cassou
02-27-07 17:00

Sorry, I forgot some methods for the tests.
 
(0010231 - 465 - 519 - 558 - 558 - 558 - 558)
Ron
02-27-07 17:07

Reviewed the code and tests. The solution works for non buffered positionable streams, which includes the streams within the current fixes hiearchy.

The suggested bug in ParagraphEditor does not appear on a 3.9a[7051] image. The problem may have been fixed in 3.9, or the current solution does not cause this error.

I ran the tests and they all pass on a Win XP sp2 box.

I recommend including this in the base image.

Ron Teitelbaum
Ron@USMedRec.com
 
(0010491 - 96 - 102 - 102 - 102 - 102 - 102)
edgardec
04-02-07 12:12

This now is 7076fixPositionableStream-isEmpty.1.cs and was in updates for 3.10
Thanks Damien !
 
(0010498 - 765 - 976 - 976 - 976 - 976 - 976)
Damien Cassou
04-07-07 15:16

Edgar, you choosed the wrong file. You choosed bugfixes-ktt.1.cs which uses the size of the collection. This implementation relies on the size of the collection:

isEmpty
  "Answer whether the receiver's contents has no elements."
  ^collection size = 0

but this is not a solution because a write stream uses a bigger collection than what it really needs (for efficiency reasons).

One of the possible correct implementation is:

isEmpty

  "Answer whether the receiver's contents has no elements."


  "Returns true if both the set of past and future sequence values of
 the receiver are empty. Otherwise returns false"


  ^ self atEnd and: [position = 0]

You should use PositionableStream-isEmpty.2.cs instead. Moreover, it contains tests.
 
(0010519 - 21 - 21 - 21 - 21 - 21 - 21)
wiz
04-11-07 05:00

see the child problem
 
(0010522 - 51 - 51 - 179 - 179 - 179 - 179)
Damien Cassou
04-11-07 06:58

Linked bug: http://bugs.squeak.org/view.php?id=6405 [^]
 
(0010523 - 191 - 245 - 245 - 245 - 245 - 245)
edgardec
04-11-07 11:31

I seeing 7083. Test are green.

all test have initials dc

#trash: keywords #('trash:')
No odd pritty print...

I HAVE a PositionableStream-isEmpty.2.cs file on my disc

Losted ...
 
(0010918 - 76 - 88 - 88 - 88 - 88 - 88)
Damien Cassou
07-23-07 09:28
edited on: 07-23-07 09:29

The fix has been included (it's present in 7130 and probably long before).

 
(0012586 - 151 - 151 - 151 - 151 - 151 - 151)
KenCausey
09-08-08 14:58

bugfixes-ktt.1.cs was harvested with update 7076. PositionableStream-isEmpty.1.cs and PositionableStream-isEmpty.2.cs were harvested with update 7085.
 

- Issue History
Date Modified Username Field Change
11-28-05 21:29 thams New Issue
11-28-05 21:29 thams File Added: bugfixes-ktt.1.cs
02-27-07 16:26 Damien Cassou Note Added: 0010228
02-27-07 16:28 Damien Cassou File Added: PositionableStream-isEmpty.1.cs
02-27-07 16:59 Damien Cassou File Added: PositionableStream-isEmpty.2.cs
02-27-07 17:00 Damien Cassou Note Added: 0010230
02-27-07 17:07 Ron Note Added: 0010231
04-02-07 12:12 edgardec Note Added: 0010491
04-07-07 15:16 Damien Cassou Note Added: 0010498
04-11-07 04:57 wiz Relationship added parent of 0006409
04-11-07 05:00 wiz Status new => feedback
04-11-07 05:00 wiz Resolution open => reopened
04-11-07 05:00 wiz Note Added: 0010519
04-11-07 06:57 Damien Cassou Issue Monitored: Damien Cassou
04-11-07 06:58 Damien Cassou Note Added: 0010522
04-11-07 11:31 edgardec Note Added: 0010523
07-23-07 09:28 Damien Cassou Note Added: 0010918
07-23-07 09:28 Damien Cassou Note Edited: 0010918
07-23-07 09:29 Damien Cassou Note Edited: 0010918
09-08-08 14:58 KenCausey Status feedback => closed
09-08-08 14:58 KenCausey Note Added: 0012586
09-08-08 14:58 KenCausey Resolution reopened => fixed
09-08-08 14:58 KenCausey Fixed in Version  => 3.10


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
96 total queries executed.
54 unique queries executed.
Powered by Mantis Bugtracker