[BUG][FIX] Inspector works forever

Boris Gaertner Boris.Gaertner at gmx.net
Sun Nov 7 12:58:37 UTC 2004


This bug report is for Squeak 3.7 gamma latest update: #5987

Albert Sacks posted an example that reveals a problem in the
inspector. In simplified form (without a class definition) his
example is:

   | foo bar |
foo _ Dictionary new.
 bar _ Dictionary new.
 foo at: #Bob put: #Jones.
 foo at: #O put: bar.
 bar at: #Bob put: #Smith.
 bar at: #O put: foo.
 (OrderedCollection with: foo with: bar)

To see the problem, evaluate this code with
"inspect it" and select  "all inst vars" in the inspector
window.

The problem is in  Inspector>>selection, where we
find this line:
 selectionIndex = 2 ifTrue: [^ object longPrintString].
Object>>longPrintString does not use a print limit;
when applied to a circular structure, it tries to print
forever. In the attached change set, you find a new
method, Object>>longPrintStringLimitedTo:,

and an improved version of
Inspector>>selection
that uses the new feature. This should fix the bug.

Comments are, as always, welcome, improvements
of my code are also welcome.

Greetings, Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InspectorFix.2.cs
Type: application/octet-stream
Size: 1694 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041107/f4a431c9/InspectorFix.2.obj


More information about the Squeak-dev mailing list