<br><br><div class="gmail_quote">2011/7/11  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
A new version of Tools was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Tools-btc.367.mcz" target="_blank">http://source.squeak.org/inbox/Tools-btc.367.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-btc.367<br>
Author: btc<br>
Time: 12 July 2011, 12:07:30.194 am<br>
UUID: bdc1afda-eed5-904b-9987-572aac977a16<br>
Ancestors: Tools-bf.366<br>
<br>
Single stepping through debugger can observe an anOrderedCollection object in an inconsistent state after creation but before initialisation.  This threw an error when the inspector asked for the size of the object - now handled.<br>

<br>
=============== Diff against Tools-bf.366 ===============<br>
<br>
Item was changed:<br>
  ----- Method: OrderedCollectionInspector&gt;&gt;fieldList (in category &#39;as yet unclassified&#39;) -----<br>
  fieldList<br>
        object ifNil: [ ^ OrderedCollection new].<br>
        ^ self baseFieldList ,<br>
+               (self objectSize &lt;= (self i1 + self i2)<br>
+                       ifTrue: [(1 to: self objectSize)<br>
-               (object size &lt;= (self i1 + self i2)<br>
-                       ifTrue: [(1 to: object size)<br>
                                                collect: [:i | i printString]]<br>
+                       ifFalse: [(1 to: self i1) , (self objectSize - (self i2-1) to: self objectSize)<br>
-                       ifFalse: [(1 to: self i1) , (object size-(self i2-1) to: object size)<br>
                                                collect: [:i | i printString]])<br>
  &quot;<br>
  OrderedCollection new inspect<br>
  (OrderedCollection newFrom: #(3 5 7 123)) inspect<br>
  (OrderedCollection newFrom: (1 to: 1000)) inspect<br>
  &quot;!<br>
<br></blockquote><div><br>I understand, OrderedCollection new inspect won&#39;t fail.<br>But you can&#39;t debugIt step by step, because just after basicNew, it will be uninitialized.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Item was added:<br>
+ ----- Method: OrderedCollectionInspector&gt;&gt;objectSize (in category &#39;as yet unclassified&#39;) -----<br>
+ objectSize<br>
+       &quot;Single stepping through a debugger can observe the object state after creation but before initiialisation.&quot;<br>
+       &quot;Thus &#39;object size&#39; may throw an axception for trying to do arithmetic on nil.&quot;<br>
+<br>
+        [ object size ] on: Exception do: [ ^ 0 ].<br>
+        ^ object size.!<br></blockquote><div><br>Is it a good idea to catch all Exception ?<br>Otherwise, there is no reason to invoke size twice, it just could be<br>^ [ object size ] on: Error do: [ 0 ]</div></div><br>
Nicolas<br>