[squeak-dev] [M7634] Cannot revert a class comment

Levente Uzonyi leves at elte.hu
Fri May 6 15:21:35 UTC 2011


On Fri, 6 May 2011, Frank Shearar wrote:

> On 2011/05/06 16:10, Levente Uzonyi wrote:
>> On Fri, 6 May 2011, Frank Shearar wrote:
>> 
>>> http://bugs.squeak.org/view.php?id=7634 says
>>> 
>>> Find a class with a class comment. Edit the comment. Click "versions".
>>> Revert to an earlier version.
>>> 
>>> "NonBooleanReceiver: proceed for truth." because instvar meta in
>>> ChangeRecord>>methodClass has as its value the class you're currently
>>> editing, rather than a boolean!
>>> 
>>> Now ClassCommentVersionBrowser>>#scanVersionsOf: says this:
>>> 
>>> self addItem:
>>> (ChangeRecord new file: file position: position type: #classComment
>>> class: class name category: nil meta: class stamp: stamp)
>>> 
>>> I can see two possible solutions: pass "class" or "class class" into
>>> the meta: parameter, or change ChangeRecord>>#methodClass to say
>> 
>> The meta variable should be a boolean, so false should be passed. This
>> is a bug since 2003 or earlier.
>> 
>>> 
>>> meta ifTrue: [ ^ methodClass class ].
>>> ^ methodClass.
>> 
>> The above code doesn't work if meta is not a boolean.
>
> You're right.
>
> meta == true ifTrue: [ ^ methodClass class ].
> ^ methodClass.
>
> is what I meant :) Which highlights the ugliness of meta being a Boolean 
> sometimes, and other times not.

All code assumes that it's a boolean, so it shouldn't be anything else 
IMHO.


Levente

>
> frank
>
>> Levente
>> 
>>> 
>>> I prefer the latter: ClassCommentVersionBrowser>>#scanVersionsOf: has
>>> been around for years, and changing ChangeRecord makes things more
>>> robust in the face of anything else being a non-Boolean.
>>> 
>>> The downside is that meta almost always contains a Boolean... except
>>> when (like now) it doesn't.
>>> 
>>> Thoughts?
>>> 
>>> frank
>>> 
>>> 
>> 
>> 
>> 
>
>
>



More information about the Squeak-dev mailing list