[squeak-dev] The Trunk: Kernel-pre.1201.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 10 19:28:35 UTC 2018

Patrick Rein uploaded a new version of Kernel to project The Trunk:

==================== Summary ====================

Name: Kernel-pre.1201
Author: pre
Time: 10 December 2018, 8:25:07.937104 pm
UUID: dab70206-4253-46e9-ae56-19ae786abf5a
Ancestors: Kernel-fn.1200

Adds the classifyAllUnclassified method to ClassOrganizer. The method name remains consistent with the classify* methods of organizers. Further recategorizes some methods from accessing to classifying

=============== Diff against Kernel-fn.1200 ===============

Item was changed:
+ ----- Method: BasicClassOrganizer>>hasNoComment (in category 'testing') -----
- ----- Method: BasicClassOrganizer>>hasNoComment (in category 'accessing') -----
  	"Answer whether the class classified by the receiver has a comment."
  	^classComment == nil!

Item was changed:
+ ----- Method: BasicClassOrganizer>>hasSubject (in category 'testing') -----
- ----- Method: BasicClassOrganizer>>hasSubject (in category 'accessing') -----
  	^ self subject notNil!

Item was changed:
+ ----- Method: Categorizer>>classify:under: (in category 'classifying') -----
- ----- Method: Categorizer>>classify:under: (in category 'accessing') -----
  classify: element under: heading 
  	self classify: element under: heading suppressIfDefault: true!

Item was changed:
+ ----- Method: Categorizer>>classify:under:suppressIfDefault: (in category 'classifying') -----
- ----- Method: Categorizer>>classify:under:suppressIfDefault: (in category 'accessing') -----
  classify: element under: heading suppressIfDefault: aBoolean
  	"Store the argument, element, in the category named heading.   If aBoolean is true, then invoke special logic such that the classification is NOT done if the new heading is the Default and the element already had a non-Default classification -- useful for filein"
  	| catName catIndex elemIndex realHeading |
  	((heading = NullCategory) or: [heading == nil])
  		ifTrue: [realHeading := Default]
  		ifFalse: [realHeading := heading asSymbol].
  	(catName := self categoryOfElement: element) = realHeading
  		ifTrue: [^ self].  "done if already under that category"
  	catName ~~ nil ifTrue: 
  		[(aBoolean and: [realHeading = Default])
  				ifTrue: [^ self].	  "return if non-Default category already assigned in memory"
  		self basicRemoveElement: element].	"remove if in another category"
  	(categoryArray indexOf: realHeading) = 0 ifTrue: [self addCategory: realHeading].
  	catIndex := categoryArray indexOf: realHeading.
  	elemIndex := 
  		catIndex > 1
  			ifTrue: [categoryStops at: catIndex - 1]
  			ifFalse: [0].
  	[(elemIndex := elemIndex + 1) <= (categoryStops at: catIndex) 
  		and: [element >= (elementArray at: elemIndex)]] whileTrue.
  	"elemIndex is now the index for inserting the element. Do the insertion before it."
  	elementArray := elementArray copyReplaceFrom: elemIndex to: elemIndex-1
  						with: (Array with: element).
  	"add one to stops for this and later categories"
  	catIndex to: categoryArray size do: 
  		[:i | categoryStops at: i put: (categoryStops at: i) + 1].
  	((categoryArray includes: Default)
  		and: [(self listAtCategoryNamed: Default) size = 0]) ifTrue: [self removeCategory: Default].
  	self assertInvariant.!

Item was changed:
+ ----- Method: Categorizer>>classifyAll:under: (in category 'classifying') -----
- ----- Method: Categorizer>>classifyAll:under: (in category 'accessing') -----
  classifyAll: aCollection under: heading
  	aCollection do:
  		[:element | self classify: element under: heading]!

Item was changed:
+ ----- Method: ClassOrganizer>>classify:under:logged: (in category 'classifying') -----
- ----- Method: ClassOrganizer>>classify:under:logged: (in category 'accessing') -----
  classify: element under: heading logged: aBoolean
  	self classify: element under: heading suppressIfDefault: true logged: aBoolean

Item was changed:
+ ----- Method: ClassOrganizer>>classify:under:suppressIfDefault: (in category 'classifying') -----
- ----- Method: ClassOrganizer>>classify:under:suppressIfDefault: (in category 'accessing') -----
  classify: element under: heading suppressIfDefault: aBoolean
  	self classify: element under: heading suppressIfDefault: aBoolean logged: false

Item was changed:
+ ----- Method: ClassOrganizer>>classify:under:suppressIfDefault:logged: (in category 'classifying') -----
- ----- Method: ClassOrganizer>>classify:under:suppressIfDefault:logged: (in category 'accessing') -----
  classify: element under: heading suppressIfDefault: aBoolean logged: logged 
  	| oldCat newCat |
  	oldCat := self categoryOfElement: element.
  	SystemChangeNotifier uniqueInstance doSilently: [
  		super classify: element under: heading suppressIfDefault: aBoolean].
  	newCat := self categoryOfElement: element.
  	self notifyOfChangedSelector: element from: oldCat to: newCat.
  	logged ifTrue: [self logChangedSelector: element category: newCat].

Item was added:
+ ----- Method: ClassOrganizer>>classifyAllUnclassified (in category 'classifying') -----
+ 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]].
+ !

More information about the Squeak-dev mailing list