FogBugz (Case [Issue]12237) Tools - Browser open is fully broken and PluggableListMorph too

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

FogBugz (Case [Issue]12237) Tools - Browser open is fully broken and PluggableListMorph too

Pharo Issue Tracker
FogBugz Notification
avatar
Stephane Ducasse opened Case 12237: Browser open is fully broken and PluggableListMorph too and assigned it to Everyone:
Bug in Project:  Tools: 1. Pharo Image  •  You are subscribed to this case
There are two issues with this bug!

- first getList could be a bit more robust

getList
"Answer the list to be displayed. Caches the returned list in the 'list' ivar"
getListSelector == nil ifTrue: [^ #()].
list := model perform: getListSelector.
list == nil ifTrue: [^ #()].
list := list collectWithIndex: [ :item :index | self wrapItem: item index: index ].
^ list
if getListSelector returns a set => it breaks

solution1

getList
"Answer the list to be displayed. Caches the returned list in the 'list' ivar"
getListSelector == nil ifTrue: [^ #()].
list := (model perform: getListSelector) asArray.
^^^^^^^^^^^

list == nil ifTrue: [^ #()].
list := list collectWithIndex: [ :item :index | self wrapItem: item index: index ].
^ list

Second in the case above getListSelector was messageList and messageList seems to returns not always arrays!!!! => consistent return violation!

messageList
"Answer an Array of the message selectors of the currently selected message category, provided that the messageCategoryListIndex is in proper range. Otherwise, answer an empty Array If messageCategoryListIndex is found to be larger than the number of categories (it happens!), it is reset to zero."
| sel |
(sel := self messageCategoryListSelection) ifNil: [
^ self classOrMetaClassOrganizer
ifNil: [Array new]
ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]
].

^ (self classOrMetaClassOrganizer listAtCategoryNumber: messageCategoryListIndex)
ifNil: [messageCategoryListIndex := 0. Array new]

Now looking a bit deeper

too me it looks like we are violating the fact that a list IS NOT A SET.

Categorizer>>allMethodSelectors
"give a list of all method selectors."

^ elementArray copy sort

ClassOrganization>>allMethodSelectors

^ protocolOrganizer allMethods

ProtocolOrganizer>>allMethods

^ self protocols gather: [:p | p methods ].

gather: aBlock
"This method is kept for compatibility reasons, use flatCollect instead."
^ self flatCollect: aBlock.

Note that it would be good to have a comment in this second method. Because now I do not know.

initialize

super initialize.

protocols := IdentitySet new.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

allProtocol := AllProtocol protocolOrganizer: self.

So I would suggest that allMethods return something with an order.
Esteban???

ProtocolOrganizer>>allMethods

^ self protocols gather: [:p | p methods ].

=>
ProtocolOrganizer>>allMethods

^ (self protocols gather: [:p | p methods ]) asArray
Priority Priority: 1 – Show Stopper !!!!!! Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Pharo3.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want FogBugz notifications anymore? Update your preferences.

FogBugz

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker