Renaming a class raises an exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Renaming a class raises an exception

ducasse

handleClassRenamed: anAnnouncement
        | items selectedIndex |
        items := self messages
                collect: [ :rgMethod |
                        | interestedClassName interestedClass |
                        interestedClassName := anAnnouncement oldName.
                        interestedClass := anAnnouncement classRenamed.
                        rgMethod isMetaSide
                                ^^^^^^^^^^^^^^^^^
                                apparently rgMethod does not understand isMetaSide

                                ifTrue: [ interestedClassName := interestedClassName , ' class'.
                                        interestedClass := interestedClass classSide ].
                        rgMethod parentName = interestedClassName
                                ifTrue: [ (interestedClass >> rgMethod selector) asFullRingDefinition ]
                                ifFalse: [ rgMethod ] ].
        selectedIndex := messageList selectedIndex.
        self messages: items.
        self setSelectedIndex: selectedIndex


Reply | Threaded
Open this post in threaded view
|

Re: Renaming a class raises an exception

ducasse
I do not get why this bug shows up now.

https://github.com/pharo-project/pharo/issues/3993

> On 17 Jul 2019, at 19:34, ducasse <[hidden email]> wrote:
>
>
> handleClassRenamed: anAnnouncement
> | items selectedIndex |
> items := self messages
> collect: [ :rgMethod |
> | interestedClassName interestedClass |
> interestedClassName := anAnnouncement oldName.
> interestedClass := anAnnouncement classRenamed.
> rgMethod isMetaSide
> ^^^^^^^^^^^^^^^^^
> apparently rgMethod does not understand isMetaSide
>
> ifTrue: [ interestedClassName := interestedClassName , ' class'.
> interestedClass := interestedClass classSide ].
> rgMethod parentName = interestedClassName
> ifTrue: [ (interestedClass >> rgMethod selector) asFullRingDefinition ]
> ifFalse: [ rgMethod ] ].
> selectedIndex := messageList selectedIndex.
> self messages: items.
> self setSelectedIndex: selectedIndex
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Renaming a class raises an exception

ducasse
I have the impression that the code of the MessageBrowser is bogus.

Stef

> On 17 Jul 2019, at 19:41, ducasse <[hidden email]> wrote:
>
> I do not get why this bug shows up now.
>
> https://github.com/pharo-project/pharo/issues/3993
>
>> On 17 Jul 2019, at 19:34, ducasse <[hidden email]> wrote:
>>
>>
>> handleClassRenamed: anAnnouncement
>> | items selectedIndex |
>> items := self messages
>> collect: [ :rgMethod |
>> | interestedClassName interestedClass |
>> interestedClassName := anAnnouncement oldName.
>> interestedClass := anAnnouncement classRenamed.
>> rgMethod isMetaSide
>> ^^^^^^^^^^^^^^^^^
>> apparently rgMethod does not understand isMetaSide
>>
>> ifTrue: [ interestedClassName := interestedClassName , ' class'.
>> interestedClass := interestedClass classSide ].
>> rgMethod parentName = interestedClassName
>> ifTrue: [ (interestedClass >> rgMethod selector) asFullRingDefinition ]
>> ifFalse: [ rgMethod ] ].
>> selectedIndex := messageList selectedIndex.
>> self messages: items.
>> self setSelectedIndex: selectedIndex
>>
>>
>
>
>