Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007434 [Squeak] System minor always 12-30-09 06:13 04-18-10 21:57
Reporter Kirtai View Status public  
Assigned To laza
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version trunk Product Version trunk
  Product Build
Summary 0007434: LRUCache>>#printOn: causes a ZeroDivide exception if the cache is not yet used.
Description When I evaluated "Object allSubInstances select: [:object | object asString ~= object printString]" it triggered a ZeroDivide exception on LRUCache>>#printOn:

That method contains the line
"(hits / calls) asFloat asString"
which of course fails if calls is zero for a not yet used cache.

A simple fix would be to check for calls being zero.
Steps To Reproduce
Additional Information
Attached Files  LRUCache.jmg.1.cs [^] (636 bytes) 01-04-10 02:09

- Relationships

- Notes
(0013454 - 102 - 102 - 102 - 102 - 102 - 102)
jgonis
01-04-10 02:10

Added a changeset to add a divide by zero check to the printOn: method. Hopefully this is acceptable.
 
(0013470 - 61 - 61 - 61 - 61 - 61 - 61)
leves
01-13-10 14:55

The best would be to upload an mcz with the fix to The Inbox.
 
(0013538 - 130 - 166 - 166 - 166 - 166 - 166)
laza
03-09-10 20:43

Fixed in 9653 with System-laza.289

This is a slightly different patch that should also make

LRUCache new printString

work
 

- Issue History
Date Modified Username Field Change
12-30-09 06:13 Kirtai New Issue
01-04-10 02:09 jgonis File Added: LRUCache.jmg.1.cs
01-04-10 02:10 jgonis Note Added: 0013454
01-13-10 14:55 leves Note Added: 0013470
03-09-10 20:43 laza Status new => resolved
03-09-10 20:43 laza Fixed in Version  => trunk
03-09-10 20:43 laza Resolution open => fixed
03-09-10 20:43 laza Assigned To  => laza
03-09-10 20:43 laza Note Added: 0013538
04-18-10 21:57 andreas Status resolved => closed


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