|
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: 1 – Show Stopper !!!!!!
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Pharo3.0
|
Go to Case
|
|