[squeak-dev] recent RecentMessages issues

Bob Arning arning315 at comcast.net
Thu Sep 26 11:28:21 UTC 2013


I got fully up-to-date this am, started making some changes, went to 
look at recent submissions and was told there were none.

Seems like

     RecentMessages startUp

would have been a useful inclusion somewhere in the update process. So, 
I did that, made some more changes and asked for recent submissions 
again. This time walkback in

RecentMessages>>mostRecent
     [methodReferences notEmpty and: [methodReferences last isValid not]]
     whileTrue: [methodReferences removeLast].
     ^ methodReferences last.

the reason being that none of the methodReferences were valid, all got 
removed and #last failed.

Why weren't they valid?

RecentMessages>>event: anEvent
     "Hook for SystemChangeNotifier"

     (anEvent isCommented and: [anEvent itemKind = SystemChangeNotifier 
classKind])
         ifTrue: [self recordSelector: #Comment forClass: anEvent item 
inEnvironment: anEvent environment].
     ((anEvent isAdded or: [anEvent isModified]) and: [anEvent itemKind 
= SystemChangeNotifier methodKind])
         ifTrue: [
             anEvent itemRequestor
                 ifNotNil: [*self recordSelector: anEvent itemSelector 
forClass: anEvent itemClass inEnvironment: anEvent environment*].
             InMidstOfFileinNotification signal
                 ifFalse: [Utilities changed: #recentMethodSubmissions]].

the change is being gathered with an environment copied from the event, 
but an event's notion of environment is something rather different from 
what MethodReference is expecting:

MethodReference>>actualClass
     ^self environment at: classSymbol ifPresent: [ :actualClass |
         classIsMeta
             ifTrue: [ actualClass classSide ]
             ifFalse: [ actualClass ] ]

so, this just returns nil and the *invalid* MR is removed.

Cheers,
Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130926/3a9c8826/attachment.htm


More information about the Squeak-dev mailing list