<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Nicolas Cellier wrote:
<blockquote
 cite="mid:CAKnRiT7C2TEUpXz_cTrmNHVxyknv1L9m2Anv4QCWxydNwgQS2g@mail.gmail.com"
 type="cite"><br>
  <br>
  <div class="gmail_quote">2011/7/11 <span dir="ltr">&lt;<a
 moz-do-not-send="true" href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;</span><br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">A
new version of Tools was added to project The Inbox:<br>
    <a moz-do-not-send="true"
 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. &nbsp;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>
&nbsp;----- Method: OrderedCollectionInspector&gt;&gt;fieldList (in category
'as yet unclassified') -----<br>
&nbsp;fieldList<br>
&nbsp; &nbsp; &nbsp; &nbsp;object ifNil: [ ^ OrderedCollection new].<br>
&nbsp; &nbsp; &nbsp; &nbsp;^ self baseFieldList ,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (self objectSize &lt;= (self i1 + self i2)<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue: [(1 to: self objectSize)<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (object size &lt;= (self i1 + self i2)<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue: [(1 to: object size)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;collect: [:i | i
printString]]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse: [(1 to: self i1) , (self objectSize -
(self i2-1) to: self objectSize)<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse: [(1 to: self i1) , (object size-(self
i2-1) to: object size)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;collect: [:i | i
printString]])<br>
&nbsp;"<br>
&nbsp;OrderedCollection new inspect<br>
&nbsp;(OrderedCollection newFrom: #(3 5 7 123)) inspect<br>
&nbsp;(OrderedCollection newFrom: (1 to: 1000)) inspect<br>
&nbsp;"!<br>
    <br>
  </blockquote>
  <div><br>
I understand, OrderedCollection new inspect won't fail.<br>
But you can't debugIt step by step, because just after basicNew, it
will be uninitialized.<br>
  </div>
  </div>
</blockquote>
Thats right, I could not debug past the basicNew and through the
'setCollection:' initialization, but I expect to be able to. I was
debugging some code step-by-step, which happened to create a new
OrderCollection, which caused the debugger to produce a
DoesNotUnderstand error that I could not get past.&nbsp; This can be
simulated by...&nbsp;&nbsp; 'self halt. OrderedCollection new: 5.'<br>
<br>
What now is the status of my two Inbox submissions?&nbsp; I assume they are
rejected but it doesn't specifically say so.&nbsp; <br>
Do you correct them as necessary to push them forward? Or do I resubmit
new ones taking on board the feedback from yourself and Levente?<br>
<blockquote
 cite="mid:CAKnRiT7C2TEUpXz_cTrmNHVxyknv1L9m2Anv4QCWxydNwgQS2g@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div>&nbsp;<br>
  </div>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Item
was added:<br>
+ ----- Method: OrderedCollectionInspector&gt;&gt;objectSize (in
category 'as yet unclassified') -----<br>
+ objectSize<br>
+ &nbsp; &nbsp; &nbsp; "Single stepping through a debugger can observe the object
state after creation but before initiialisation."<br>
+ &nbsp; &nbsp; &nbsp; "Thus 'object size' may throw an axception for trying to do
arithmetic on nil."<br>
+<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[ object size ] on: Exception do: [ ^ 0 ].<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;^ 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>
  <pre wrap="">
<hr size="4" width="90%">

  </pre>
</blockquote>
<br>
</body>
</html>