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

Frank Shearar frank.shearar at angband.za.org
Fri May 6 11:50:00 UTC 2011


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

   meta ifTrue: [ ^ methodClass class ].
   ^ methodClass.

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