[squeak-dev] ClassOrganizer and classifyAllUnclassfied

patrick.rein at hpi.uni-potsdam.de patrick.rein at hpi.uni-potsdam.de
Thu Dec 6 19:28:24 UTC 2018


Hi all,

while going through categories I naturally came by the source code for categorizing all uncategorized messages through the context menu in the Browser (Browser>>#categorizeAllUncategorizedMethods). I found that that method implemented the logic of classifying methods which I found odd as this sounds like something the class organizer should take care of. Thus, I rewrote the two classes to the code below:

Browser>>#categorizeAllUncategorizedMethods
	"Categorize methods by looking in parent classes for a method category."

	self classOrMetaClassOrganizer classifyAllUnclassified.
	self changed: #messageCategoryList

ClassOrganizer>>#classifyAllUnclassified

	| organizers |
	organizers := self subject withAllSuperclasses collect: [:ea | ea organization].
	(self listAtCategoryNamed: ClassOrganizer default) do: [:sel | | found |
		found := (organizers collect: [ :org | org categoryOfElement: sel])
			detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
			ifNone: [].
		found ifNotNil: [self classify: sel under: found]].


Does anyone have any opinion on that? I really prefer that version but I wanted to check first if there is a good reason not to have this in the Organizers.

Bests
Patrick

P.S.: I also just noticed a weird inconsistency in the naming scheme between categorizing (Browser) and classifying (Organizer). 


More information about the Squeak-dev mailing list